[alsa-devel] [PATCH v3 00/10] ACPI / utils: Replace leaky function
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3: - convert all existing users and drop old API (Mika) - add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API. And then remove the old one.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede hdegoede@redhat.com --- drivers/acpi/utils.c | 24 ++++++++++++++++++++++-- include/acpi/acpi_bus.h | 3 +++ include/linux/acpi.h | 6 ++++++ 3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index c4b06cc075f9..5a2bae2b6c3a 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -739,6 +739,7 @@ EXPORT_SYMBOL(acpi_dev_found);
struct acpi_dev_match_info { const char *dev_name; + struct acpi_device *adev; struct acpi_device_id hid[2]; const char *uid; s64 hrv; @@ -759,6 +760,7 @@ static int acpi_dev_match_cb(struct device *dev, void *data) return 0;
match->dev_name = acpi_dev_name(adev); + match->adev = adev;
if (match->hrv == -1) return 1; @@ -806,16 +808,34 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) EXPORT_SYMBOL(acpi_dev_present);
/** - * acpi_dev_get_first_match_name - Return name of first match of ACPI device + * acpi_dev_get_first_match_dev - Return the first match of ACPI device * @hid: Hardware ID of the device. * @uid: Unique ID of the device, pass NULL to not check _UID * @hrv: Hardware Revision of the device, pass -1 to not check _HRV * - * Return device name if a matching device was present + * Return the first match of ACPI device if a matching device was present * at the moment of invocation, or NULL otherwise. * + * The caller is responsible to call put_device() on the returned device. + * * See additional information in acpi_dev_present() as well. */ +struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{ + struct acpi_dev_match_info match = {}; + struct device *dev; + + strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); + match.uid = uid; + match.hrv = hrv; + + dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); + return dev ? match.adev : NULL; +} +EXPORT_SYMBOL(acpi_dev_get_first_match_dev); + +/* DEPRECATED, use acpi_dev_get_first_match_dev() instead */ const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 0300374101cd..2063e9e2f384 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
+struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv); + const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5dcebd7aad3..3e1d16b00513 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -669,6 +669,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) return false; }
+static inline struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{ + return NULL; +} + static inline const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) {
On Thu, Mar 28, 2019 at 6:17 PM Andy Shevchenko andriy.shevchenko@linux.intel.com wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API. And then remove the old one.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede hdegoede@redhat.com
Any differences between this and the previous one? I've queued up that one already.
drivers/acpi/utils.c | 24 ++++++++++++++++++++++-- include/acpi/acpi_bus.h | 3 +++ include/linux/acpi.h | 6 ++++++ 3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index c4b06cc075f9..5a2bae2b6c3a 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -739,6 +739,7 @@ EXPORT_SYMBOL(acpi_dev_found);
struct acpi_dev_match_info { const char *dev_name;
struct acpi_device *adev; struct acpi_device_id hid[2]; const char *uid; s64 hrv;
@@ -759,6 +760,7 @@ static int acpi_dev_match_cb(struct device *dev, void *data) return 0;
match->dev_name = acpi_dev_name(adev);
match->adev = adev; if (match->hrv == -1) return 1;
@@ -806,16 +808,34 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) EXPORT_SYMBOL(acpi_dev_present);
/**
- acpi_dev_get_first_match_name - Return name of first match of ACPI device
- acpi_dev_get_first_match_dev - Return the first match of ACPI device
- @hid: Hardware ID of the device.
- @uid: Unique ID of the device, pass NULL to not check _UID
- @hrv: Hardware Revision of the device, pass -1 to not check _HRV
- Return device name if a matching device was present
- Return the first match of ACPI device if a matching device was present
- at the moment of invocation, or NULL otherwise.
- The caller is responsible to call put_device() on the returned device.
*/
- See additional information in acpi_dev_present() as well.
+struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{
struct acpi_dev_match_info match = {};
struct device *dev;
strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
match.uid = uid;
match.hrv = hrv;
dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
return dev ? match.adev : NULL;
+} +EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
+/* DEPRECATED, use acpi_dev_get_first_match_dev() instead */ const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 0300374101cd..2063e9e2f384 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
+struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5dcebd7aad3..3e1d16b00513 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -669,6 +669,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) return false; }
+static inline struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{
return NULL;
+}
static inline const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { -- 2.20.1
On Thu, Mar 28, 2019 at 09:12:49PM +0100, Rafael J. Wysocki wrote:
On Thu, Mar 28, 2019 at 6:17 PM Andy Shevchenko andriy.shevchenko@linux.intel.com wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API. And then remove the old one.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede hdegoede@redhat.com
Any differences between this and the previous one? I've queued up that one already.
Not a single bit. Just Hans' tag is added.
drivers/acpi/utils.c | 24 ++++++++++++++++++++++-- include/acpi/acpi_bus.h | 3 +++ include/linux/acpi.h | 6 ++++++ 3 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index c4b06cc075f9..5a2bae2b6c3a 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -739,6 +739,7 @@ EXPORT_SYMBOL(acpi_dev_found);
struct acpi_dev_match_info { const char *dev_name;
struct acpi_device *adev; struct acpi_device_id hid[2]; const char *uid; s64 hrv;
@@ -759,6 +760,7 @@ static int acpi_dev_match_cb(struct device *dev, void *data) return 0;
match->dev_name = acpi_dev_name(adev);
match->adev = adev; if (match->hrv == -1) return 1;
@@ -806,16 +808,34 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) EXPORT_SYMBOL(acpi_dev_present);
/**
- acpi_dev_get_first_match_name - Return name of first match of ACPI device
- acpi_dev_get_first_match_dev - Return the first match of ACPI device
- @hid: Hardware ID of the device.
- @uid: Unique ID of the device, pass NULL to not check _UID
- @hrv: Hardware Revision of the device, pass -1 to not check _HRV
- Return device name if a matching device was present
- Return the first match of ACPI device if a matching device was present
- at the moment of invocation, or NULL otherwise.
- The caller is responsible to call put_device() on the returned device.
*/
- See additional information in acpi_dev_present() as well.
+struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{
struct acpi_dev_match_info match = {};
struct device *dev;
strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id));
match.uid = uid;
match.hrv = hrv;
dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
return dev ? match.adev : NULL;
+} +EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
+/* DEPRECATED, use acpi_dev_get_first_match_dev() instead */ const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 0300374101cd..2063e9e2f384 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -91,6 +91,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
+struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index d5dcebd7aad3..3e1d16b00513 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -669,6 +669,12 @@ static inline bool acpi_dev_present(const char *hid, const char *uid, s64 hrv) return false; }
+static inline struct acpi_device * +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) +{
return NULL;
+}
static inline const char * acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) { -- 2.20.1
On Thu, Mar 28, 2019 at 07:17:20PM +0200, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API. And then remove the old one.
Acked-by: Mark Brown broonie@kernel.org
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Cc: Chanwoo Choi cw00.choi@samsung.com Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- drivers/extcon/extcon-axp288.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) struct axp288_extcon_info *info; struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); struct device *dev = &pdev->dev; - const char *name; + struct acpi_device *adev; int ret, i, pirq;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); @@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) if (ret) return ret;
- name = acpi_dev_get_first_match_name("INT3496", NULL, -1); - if (name) { - info->id_extcon = extcon_get_extcon_dev(name); + adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1); + if (adev) { + info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev)); + put_device(&adev->dev); if (!info->id_extcon) return -EPROBE_DEFER;
Hi Andy,
On 19. 3. 29. 오전 2:17, Andy Shevchenko wrote:
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Cc: Chanwoo Choi cw00.choi@samsung.com Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com
drivers/extcon/extcon-axp288.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) struct axp288_extcon_info *info; struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); struct device *dev = &pdev->dev;
- const char *name;
struct acpi_device *adev; int ret, i, pirq;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) if (ret) return ret;
name = acpi_dev_get_first_match_name("INT3496", NULL, -1);
if (name) {
info->id_extcon = extcon_get_extcon_dev(name);
adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1);
if (adev) {
info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev));
put_device(&adev->dev); if (!info->id_extcon) return -EPROBE_DEFER;
Applied it. Thanks.
On Friday, March 29, 2019 1:53:09 AM CET Chanwoo Choi wrote:
Hi Andy,
On 19. 3. 29. 오전 2:17, Andy Shevchenko wrote:
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Cc: Chanwoo Choi cw00.choi@samsung.com Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com
drivers/extcon/extcon-axp288.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) struct axp288_extcon_info *info; struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); struct device *dev = &pdev->dev;
- const char *name;
struct acpi_device *adev; int ret, i, pirq;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) if (ret) return ret;
name = acpi_dev_get_first_match_name("INT3496", NULL, -1);
if (name) {
info->id_extcon = extcon_get_extcon_dev(name);
adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1);
if (adev) {
info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev));
put_device(&adev->dev); if (!info->id_extcon) return -EPROBE_DEFER;
Applied it. Thanks.
But it won't build without the first patch I suppose?
ACK, please?
Hi Rafael,
On 19. 3. 30. 오전 7:58, Rafael J. Wysocki wrote:
On Friday, March 29, 2019 1:53:09 AM CET Chanwoo Choi wrote:
Hi Andy,
On 19. 3. 29. 오전 2:17, Andy Shevchenko wrote:
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Cc: Chanwoo Choi cw00.choi@samsung.com Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chen-Yu Tsai wens@csie.org Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com
drivers/extcon/extcon-axp288.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c index a983708b77a6..50f9402fb325 100644 --- a/drivers/extcon/extcon-axp288.c +++ b/drivers/extcon/extcon-axp288.c @@ -333,7 +333,7 @@ static int axp288_extcon_probe(struct platform_device *pdev) struct axp288_extcon_info *info; struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); struct device *dev = &pdev->dev;
- const char *name;
struct acpi_device *adev; int ret, i, pirq;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -357,9 +357,10 @@ static int axp288_extcon_probe(struct platform_device *pdev) if (ret) return ret;
name = acpi_dev_get_first_match_name("INT3496", NULL, -1);
if (name) {
info->id_extcon = extcon_get_extcon_dev(name);
adev = acpi_dev_get_first_match_dev("INT3496", NULL, -1);
if (adev) {
info->id_extcon = extcon_get_extcon_dev(acpi_dev_name(adev));
put_device(&adev->dev); if (!info->id_extcon) return -EPROBE_DEFER;
Applied it. Thanks.
But it won't build without the first patch I suppose?
ACK, please?
It is my fault. I'll drop it from extcon.git.
Acked-by: Chanwoo Choi cw00.choi@samsung.com
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede hdegoede@redhat.com --- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c index 7c659fdaa6d5..2383dc78b123 100644 --- a/drivers/gpio/gpio-merrifield.c +++ b/drivers/gpio/gpio-merrifield.c @@ -377,10 +377,20 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv) } }
-static const char *mrfld_gpio_get_pinctrl_dev_name(void) +static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv) { - const char *dev_name = acpi_dev_get_first_match_name("INTC1002", NULL, -1); - return dev_name ? dev_name : "pinctrl-merrifield"; + struct acpi_device *adev; + const char *name; + + adev = acpi_dev_get_first_match_dev("INTC1002", NULL, -1); + if (adev) { + name = devm_kstrdup(priv->dev, acpi_dev_name(adev), GFP_KERNEL); + put_device(&adev->dev); + } else { + name = "pinctrl-merrifield"; + } + + return name; }
static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id) @@ -441,7 +451,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id return retval; }
- pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(); + pinctrl_dev_name = mrfld_gpio_get_pinctrl_dev_name(priv); for (i = 0; i < ARRAY_SIZE(mrfld_gpio_ranges); i++) { range = &mrfld_gpio_ranges[i]; retval = gpiochip_add_pin_range(&priv->chip,
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/boards/bytcht_da7213.c b/sound/soc/intel/boards/bytcht_da7213.c index b8e884803777..4decba338156 100644 --- a/sound/soc/intel/boards/bytcht_da7213.c +++ b/sound/soc/intel/boards/bytcht_da7213.c @@ -226,7 +226,7 @@ static int bytcht_da7213_probe(struct platform_device *pdev) struct snd_soc_card *card; struct snd_soc_acpi_mach *mach; const char *platform_name; - const char *i2c_name = NULL; + struct acpi_device *adev; int dai_index = 0; int ret_val = 0; int i; @@ -244,10 +244,11 @@ static int bytcht_da7213_probe(struct platform_device *pdev) }
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { snprintf(codec_name, sizeof(codec_name), - "%s%s", "i2c-", i2c_name); + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); dailink[dai_index].codec_name = codec_name; }
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c index d2a7e6ba11ae..6937c00cf63d 100644 --- a/sound/soc/intel/boards/bytcht_es8316.c +++ b/sound/soc/intel/boards/bytcht_es8316.c @@ -442,7 +442,7 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct snd_soc_acpi_mach *mach; const char *platform_name; - const char *i2c_name = NULL; + struct acpi_device *adev; struct device *codec_dev; int dai_index = 0; int i; @@ -463,10 +463,11 @@ static int snd_byt_cht_es8316_mc_probe(struct platform_device *pdev) }
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { snprintf(codec_name, sizeof(codec_name), - "%s%s", "i2c-", i2c_name); + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); byt_cht_es8316_dais[dai_index].codec_name = codec_name; }
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c index 940eb27158da..f9175cf6747e 100644 --- a/sound/soc/intel/boards/bytcr_rt5640.c +++ b/sound/soc/intel/boards/bytcr_rt5640.c @@ -1154,7 +1154,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) struct byt_rt5640_private *priv; struct snd_soc_acpi_mach *mach; const char *platform_name; - const char *i2c_name = NULL; + struct acpi_device *adev; int ret_val = 0; int dai_index = 0; int i; @@ -1178,11 +1178,11 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) }
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { snprintf(byt_rt5640_codec_name, sizeof(byt_rt5640_codec_name), - "%s%s", "i2c-", i2c_name); - + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); byt_rt5640_dais[dai_index].codec_name = byt_rt5640_codec_name; }
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index b0a4d297176e..b744add01d12 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -867,8 +867,8 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) struct byt_rt5651_private *priv; struct snd_soc_acpi_mach *mach; const char *platform_name; + struct acpi_device *adev; struct device *codec_dev; - const char *i2c_name = NULL; const char *hp_swapped; bool is_bytcr = false; int ret_val = 0; @@ -894,14 +894,16 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) }
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (!i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { + snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); + byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; + } else { dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); return -ENODEV; } - snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), - "%s%s", "i2c-", i2c_name); - byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name;
codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, byt_rt5651_codec_name);
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c index cbc2d458483f..32dbeaf1ab94 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5645.c +++ b/sound/soc/intel/boards/cht_bsw_rt5645.c @@ -532,7 +532,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) struct snd_soc_acpi_mach *mach; const char *platform_name; struct cht_mc_private *drv; - const char *i2c_name = NULL; + struct acpi_device *adev; bool found = false; bool is_bytcr = false; int dai_index = 0; @@ -573,10 +573,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev) }
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { snprintf(cht_rt5645_codec_name, sizeof(cht_rt5645_codec_name), - "%s%s", "i2c-", i2c_name); + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); cht_dailink[dai_index].codec_name = cht_rt5645_codec_name; }
acpi_dev_get_first_match_name() is deprecated and going to be removed because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c index 3d5a2b3a06f0..0f7770822388 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5672.c +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c @@ -401,7 +401,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) struct cht_mc_private *drv; struct snd_soc_acpi_mach *mach = pdev->dev.platform_data; const char *platform_name; - const char *i2c_name; + struct acpi_device *adev; int i;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); @@ -411,10 +411,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev) strcpy(drv->codec_name, RT5672_I2C_DEFAULT);
/* fixup codec name based on HID */ - i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { + adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); + if (adev) { snprintf(drv->codec_name, sizeof(drv->codec_name), - "i2c-%s", i2c_name); + "i2c-%s", acpi_dev_name(adev)); + put_device(&adev->dev); for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) { if (!strcmp(cht_dailink[i].codec_name, RT5672_I2C_DEFAULT)) {
There is no more user of acpi_dev_get_first_match_name(), which is deprecated and has no user left, so, remove it for good.
Signed-off-by: Andy Shevchenko andriy.shevchenko@linux.intel.com --- drivers/acpi/utils.c | 16 ---------------- include/acpi/acpi_bus.h | 3 --- include/linux/acpi.h | 6 ------ 3 files changed, 25 deletions(-)
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 5a2bae2b6c3a..89363b245489 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -835,22 +835,6 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) } EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
-/* DEPRECATED, use acpi_dev_get_first_match_dev() instead */ -const char * -acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) -{ - struct acpi_dev_match_info match = {}; - struct device *dev; - - strlcpy(match.hid[0].id, hid, sizeof(match.hid[0].id)); - match.uid = uid; - match.hrv = hrv; - - dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); - return dev ? match.dev_name : NULL; -} -EXPORT_SYMBOL(acpi_dev_get_first_match_name); - /* * acpi_backlight= handling, this is done here rather then in video_detect.c * because __setup cannot be used in modules. diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 2063e9e2f384..f7981751ac77 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -94,9 +94,6 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); struct acpi_device * acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
-const char * -acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv); - #ifdef CONFIG_ACPI
#include <linux/proc_fs.h> diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3e1d16b00513..392413075cc0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -675,12 +675,6 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) return NULL; }
-static inline const char * -acpi_dev_get_first_match_name(const char *hid, const char *uid, s64 hrv) -{ - return NULL; -} - static inline bool is_acpi_node(struct fwnode_handle *fwnode) { return false;
On 3/28/19 1:17 PM, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Patches 4..9 for the Intel machine drivers:
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Is this going to be merged through the ACPI or ASoC tree? The changes will conflict with cleanups I started to use the 'modern' dailinks (codec_name -> codecs[0].name), so some level of coordination is needed.
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
On Thu, Mar 28, 2019 at 02:31:28PM -0400, Pierre-Louis Bossart wrote:
On 3/28/19 1:17 PM, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Patches 4..9 for the Intel machine drivers:
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Thank you!
Is this going to be merged through the ACPI or ASoC tree? The changes will conflict with cleanups I started to use the 'modern' dailinks (codec_name -> codecs[0].name), so some level of coordination is needed.
I suppose via ACPI.
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
On Thu, Mar 28, 2019 at 10:40 PM Andy Shevchenko andriy.shevchenko@linux.intel.com wrote:
On Thu, Mar 28, 2019 at 02:31:28PM -0400, Pierre-Louis Bossart wrote:
On 3/28/19 1:17 PM, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Patches 4..9 for the Intel machine drivers:
Acked-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Thank you!
Is this going to be merged through the ACPI or ASoC tree? The changes will conflict with cleanups I started to use the 'modern' dailinks (codec_name -> codecs[0].name), so some level of coordination is needed.
I suppose via ACPI.
I can expose a non-volatile branch with this material, would that work?
On Fri, Mar 29, 2019 at 12:33:33AM +0100, Rafael J. Wysocki wrote:
On Thu, Mar 28, 2019 at 10:40 PM Andy Shevchenko
Is this going to be merged through the ACPI or ASoC tree? The changes will conflict with cleanups I started to use the 'modern' dailinks (codec_name -> codecs[0].name), so some level of coordination is needed.
I suppose via ACPI.
I can expose a non-volatile branch with this material, would that work?
That would be very helpful, please - there's a lot of work going on with the ASoC Intel drivers in order to add SoF support so there's likely to be some kind of overlaps.
On Monday, April 1, 2019 9:24:35 AM CEST Mark Brown wrote:
--cYtjc4pxslFTELvY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline
On Fri, Mar 29, 2019 at 12:33:33AM +0100, Rafael J. Wysocki wrote:
On Thu, Mar 28, 2019 at 10:40 PM Andy Shevchenko
Is this going to be merged through the ACPI or ASoC tree? The changes will conflict with cleanups I started to use the 'modern' dailinks (codec_name -> codecs[0].name), so some level of coordination is needed.
I suppose via ACPI.
I can expose a non-volatile branch with this material, would that work?
That would be very helpful, please - there's a lot of work going on with the ASoC Intel drivers in order to add SoF support so there's likely to be some kind of overlaps.
The series is available for pulling in the git branch at
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git \ acpi-utils
on top of 5.1-rc3 with top-most commit 257f9053c0204ea47491aa236004fd1226f75fa8
ACPI / utils: Remove deprecated function since no user left
Thanks!
Hi,
On 28-03-19 18:17, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
The entire series looks good to me:
Reviewed-by: Hans de Goede hdegoede@redhat.com
For the entire series.
Regards,
Hans
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
On Thu, Mar 28, 2019 at 07:17:19PM +0200, Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
For the entire series,
Reviewed-by: Mika Westerberg mika.westerberg@linux.intel.com
On Thursday, March 28, 2019 6:17:19 PM CEST Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
All applied (with the tags selected so far), thanks!
On Tue, Apr 2, 2019 at 10:59 AM Rafael J. Wysocki rjw@rjwysocki.net wrote:
On Thursday, March 28, 2019 6:17:19 PM CEST Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
Cc: MyungJoo Ham myungjoo.ham@samsung.com Cc: Chanwoo Choi cw00.choi@samsung.com Cc: Chen-Yu Tsai wens@csie.org Cc: Linus Walleij linus.walleij@linaro.org Cc: Bartosz Golaszewski bgolaszewski@baylibre.com
Andy Shevchenko (10): ACPI / utils: Introduce acpi_dev_get_first_match_dev() helper extcon: axp288: Convert to use acpi_dev_get_first_match_dev() gpio: merrifield: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcht_es8316: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5640: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: bytcr_rt5651: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5645: Convert to use acpi_dev_get_first_match_dev() ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev() ACPI / utils: Remove deprecated function since no user left
drivers/acpi/utils.c | 16 ++++++++++------ drivers/extcon/extcon-axp288.c | 9 +++++---- drivers/gpio/gpio-merrifield.c | 18 ++++++++++++++---- include/acpi/acpi_bus.h | 4 ++-- include/linux/acpi.h | 4 ++-- sound/soc/intel/boards/bytcht_da7213.c | 9 +++++---- sound/soc/intel/boards/bytcht_es8316.c | 9 +++++---- sound/soc/intel/boards/bytcr_rt5640.c | 10 +++++----- sound/soc/intel/boards/bytcr_rt5651.c | 14 ++++++++------ sound/soc/intel/boards/cht_bsw_rt5645.c | 9 +++++---- sound/soc/intel/boards/cht_bsw_rt5672.c | 9 +++++---- 11 files changed, 66 insertions(+), 45 deletions(-)
All applied (with the tags selected so far), thanks!
s/selected/collected/
Strange ...
On Tue, Apr 02, 2019 at 11:17:06AM +0200, Rafael J. Wysocki wrote:
On Tue, Apr 2, 2019 at 10:59 AM Rafael J. Wysocki rjw@rjwysocki.net wrote:
On Thursday, March 28, 2019 6:17:19 PM CEST Andy Shevchenko wrote:
The acpi_dev_get_first_match_name() is missing put_device() call and thus keeping reference counting unbalanced.
In order to fix the issue introduce a new helper to convert existing users one-by-one to a better API.
Since v3:
- convert all existing users and drop old API (Mika)
- add Hans' tag
All applied (with the tags selected so far), thanks!
s/selected/collected/
Strange ...
Thank you, Rafael!
participants (8)
-
Andy Shevchenko
-
Chanwoo Choi
-
Hans de Goede
-
Mark Brown
-
Mika Westerberg
-
Pierre-Louis Bossart
-
Rafael J. Wysocki
-
Rafael J. Wysocki