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.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEsSpuqBtbWtRe4rLGnM3fLN7rz1MFAmWAx9gACgkQnM3fLN7r
 z1ORMg//SGXMJx3P2ftYtjxQN0pn/EdyMFQwRzSMW484nsm/3lbpNsVlf/50b536
 HBTUt+mkD/nUhWkEjPFfzPmWJWvX8tw/ly17aBi1VhBneJhAmxDggjNZAeTm4Xby
 M5H+XvU4m+QeGLGuFqB03q/6UEHjmkn/I5f6cFUl+NYUTNNndT3Dyxfy98CpXcIR
 r7ir5SgucLbjS4kwQluBE01fiGSE93xxFYFM/36JwOL7QBdXwVh0kSTcw5X1WMZd
 +u81xU41P4CJDLcrtMAERuZbzVfZebUjMuPwNorgHV7RK5KmENlADh0HZxDmRWBK
 pdyJXnK0C2Q4y+7zxzjRwsWBQ2CkWRyq1Gb93b41hD8MKZYITAS2y5FzczQ17iPk
 KyOnJ8f1bXg5L0d4X5XVTBcy/7ZrgzJzvK51rD+78h7zFNW/T97pUzOt6KXaaY9X
 YxTlCY2oxPJxpEjdWoBkRC2AX3wKL1b8KmO0x6uJ9ue4D0WhqGDr4PgRzE12eFxb
 8kiu0cgcKvXTNGUam6BzWeu9uJ+6zX95Bybywh566jDqvUNHV50wCh2yRHQlj1Lr
 VciwPW3iVPqeXIBOgHrxFM42bcsAK7b9PucxTjzVOhdJqGO8nww07eecPTnDZ2tI
 kT0JpJpxpLOs4pps/szqqmxTaaQcWCqc49rqLRJdl4EOdZjRPpw=
 =KBLg
 -----END PGP SIGNATURE-----

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:
Greg Kroah-Hartman 2023-12-19 08:57:56 +01:00
commit a833c84a5a
3 changed files with 10 additions and 4 deletions

View File

@ -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.
*

View File

@ -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);

View File

@ -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);