mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 22:57:21 -04:00
Merge tag 'extcon-next-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes: Update extcon next for v6.8 Detailed description for this pull request: 1. Fix possible memory leak of device name in extcon_dev_register() : Fix memory leak on error path of extcon_dev_register(). 2. Set interrupt polarity based on device-tree for extcon-usbc-tusb320.c :Remove 'IRQF_TRIGGER_FALLING' request which is not allowed on every interrupt controller (i.e. arm64 GIC). Replace flag by a request that depends on the actual device-tree setting. 3. Fix the comment style according to guide on extcon-qcom-spmi-misc.c. * tag 'extcon-next-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: qcom-spmi-misc: don't use kernel-doc marker for comment extcon: usbc-tusb320: Set interrupt polarity based on device-tree extcon: fix possible name leak in extcon_dev_register()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/**
|
||||
/*
|
||||
* extcon-qcom-spmi-misc.c - Qualcomm USB extcon driver to support USB ID
|
||||
* and VBUS detection based on extcon-usb-gpio.c.
|
||||
*
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <linux/usb/typec.h>
|
||||
#include <linux/usb/typec_altmode.h>
|
||||
#include <linux/usb/role.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#define TUSB320_REG8 0x8
|
||||
#define TUSB320_REG8_CURRENT_MODE_ADVERTISE GENMASK(7, 6)
|
||||
@@ -515,6 +516,8 @@ static int tusb320_probe(struct i2c_client *client)
|
||||
const void *match_data;
|
||||
unsigned int revision;
|
||||
int ret;
|
||||
u32 irq_trigger_type = IRQF_TRIGGER_FALLING;
|
||||
struct irq_data *irq_d;
|
||||
|
||||
priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
@@ -568,9 +571,13 @@ static int tusb320_probe(struct i2c_client *client)
|
||||
*/
|
||||
tusb320_state_update_handler(priv, true);
|
||||
|
||||
irq_d = irq_get_irq_data(client->irq);
|
||||
if (irq_d)
|
||||
irq_trigger_type = irqd_get_trigger_type(irq_d);
|
||||
|
||||
ret = devm_request_threaded_irq(priv->dev, client->irq, NULL,
|
||||
tusb320_irq_handler,
|
||||
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
|
||||
IRQF_ONESHOT | irq_trigger_type,
|
||||
client->name, priv);
|
||||
if (ret)
|
||||
tusb320_typec_remove(priv);
|
||||
|
||||
@@ -1280,8 +1280,6 @@ int extcon_dev_register(struct extcon_dev *edev)
|
||||
|
||||
edev->id = ret;
|
||||
|
||||
dev_set_name(&edev->dev, "extcon%d", edev->id);
|
||||
|
||||
ret = extcon_alloc_cables(edev);
|
||||
if (ret < 0)
|
||||
goto err_alloc_cables;
|
||||
@@ -1310,6 +1308,7 @@ int extcon_dev_register(struct extcon_dev *edev)
|
||||
RAW_INIT_NOTIFIER_HEAD(&edev->nh_all);
|
||||
|
||||
dev_set_drvdata(&edev->dev, edev);
|
||||
dev_set_name(&edev->dev, "extcon%d", edev->id);
|
||||
edev->state = 0;
|
||||
|
||||
ret = device_register(&edev->dev);
|
||||
|
||||
Reference in New Issue
Block a user