2019-04-04 10:44:23

by Yue Haibing

[permalink] [raw]
Subject: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI

From: YueHaibing <[email protected]>

When building CONFIG_ACPI is not set
gcc warn this:

drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
put_device(&adev->dev);
^
Reported-by: Hulk Robot <[email protected]>
Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
Signed-off-by: YueHaibing <[email protected]>
---
drivers/gpio/gpio-merrifield.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index 2383dc7..78ac32f 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -379,17 +379,18 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv)

static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
{
- struct acpi_device *adev;
const char *name;
+#ifdef CONFIG_ACPI
+ struct acpi_device *adev;

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";
}
-
+#else
+ name = "pinctrl-merrifield";
+#endif
return name;
}

--
2.7.4



2019-04-04 11:41:27

by Mukesh Ojha

[permalink] [raw]
Subject: Re: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI


On 4/4/2019 4:09 PM, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^
> Reported-by: Hulk Robot <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>

Cheers,
-Mukesh
> ---
> drivers/gpio/gpio-merrifield.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index 2383dc7..78ac32f 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -379,17 +379,18 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv)
>
> static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
> {
> - struct acpi_device *adev;
> const char *name;
> +#ifdef CONFIG_ACPI
> + struct acpi_device *adev;
>
> 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";
> }
> -
> +#else
> + name = "pinctrl-merrifield";
> +#endif
> return name;
> }
>

2019-04-04 11:45:04

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI

On Thu, Apr 04, 2019 at 06:39:25PM +0800, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^

Thanks for the patch. My comment below.

This patch went through ACPI subsystem, so, include Rafael and linux-acpi
mailing list in next iteration.

> Reported-by: Hulk Robot <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Signed-off-by: YueHaibing <[email protected]>
> ---
> drivers/gpio/gpio-merrifield.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index 2383dc7..78ac32f 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -379,17 +379,18 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv)
>
> static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
> {
> - struct acpi_device *adev;
> const char *name;
> +#ifdef CONFIG_ACPI
> + struct acpi_device *adev;
>
> 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";
> }

This will break ACPI=y on non-ACPI platform, where we need to fallback to
the platform driver name.


Better to do the following in acpi.h

#ifdef CONFIG_ACPI
static inline void put_acpi_device(struct acpi_device *adev)
{
put_device(&adev->dev);
}
#else
static inline void put_acpi_device(struct acpi_device *adev) {}
#endif

> -
> +#else
> + name = "pinctrl-merrifield";
> +#endif
> return name;
> }

--
With Best Regards,
Andy Shevchenko


2019-04-04 14:06:30

by Yue Haibing

[permalink] [raw]
Subject: Re: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI

+cc Rafael and linux-acpi

On 2019/4/4 18:39, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^
> Reported-by: Hulk Robot <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Signed-off-by: YueHaibing <[email protected]>
> ---
> drivers/gpio/gpio-merrifield.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index 2383dc7..78ac32f 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -379,17 +379,18 @@ static void mrfld_irq_init_hw(struct mrfld_gpio *priv)
>
> static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
> {
> - struct acpi_device *adev;
> const char *name;
> +#ifdef CONFIG_ACPI
> + struct acpi_device *adev;
>
> 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";
> }
> -
> +#else
> + name = "pinctrl-merrifield";
> +#endif
> return name;
> }
>
>

2019-04-05 10:08:10

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI

On Thu, Apr 04, 2019 at 10:04:04PM +0800, YueHaibing wrote:
> +cc Rafael and linux-acpi

Yeah, but please, address my comments and send v2.

--
With Best Regards,
Andy Shevchenko


2019-04-05 12:13:02

by Yue Haibing

[permalink] [raw]
Subject: Re: [PATCH] gpio: merrifield: Fix build err without CONFIG_ACPI


On 2019/4/5 18:07, Andy Shevchenko wrote:
> On Thu, Apr 04, 2019 at 10:04:04PM +0800, YueHaibing wrote:
>> +cc Rafael and linux-acpi
>
> Yeah, but please, address my comments and send v2.

Oh, sorry, I just forgot to send v2.

>

2019-04-05 14:23:58

by Yue Haibing

[permalink] [raw]
Subject: [PATCH v2] gpio: merrifield: Fix build err without CONFIG_ACPI

From: YueHaibing <[email protected]>

When building CONFIG_ACPI is not set
gcc warn this:

drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
put_device(&adev->dev);
^
Reported-by: Hulk Robot <[email protected]>
Suggested-by: Andy Shevchenko <[email protected]>
Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
Signed-off-by: YueHaibing <[email protected]>
---
v2: rework patch use put_acpi_device helper
---
drivers/gpio/gpio-merrifield.c | 2 +-
include/linux/acpi.h | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index 2383dc7..99ca18c 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -385,7 +385,7 @@ static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
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);
+ put_acpi_device(adev);
} else {
name = "pinctrl-merrifield";
}
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index a1bd789..2563e13 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1331,12 +1331,19 @@ static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level)

#ifdef CONFIG_ACPI
extern int acpi_platform_notify(struct device *dev, enum kobject_action action);
+
+static inline void put_acpi_device(struct acpi_device *adev)
+{
+ put_device(&adev->dev);
+}
#else
static inline int
acpi_platform_notify(struct device *dev, enum kobject_action action)
{
return 0;
}
+
+static inline void put_acpi_device(struct acpi_device *adev) {}
#endif

#endif /*_LINUX_ACPI_H*/
--
2.7.4


2019-04-05 14:51:51

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2] gpio: merrifield: Fix build err without CONFIG_ACPI

On Fri, Apr 05, 2019 at 10:21:12PM +0800, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^
> Reported-by: Hulk Robot <[email protected]>
> Suggested-by: Andy Shevchenko <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Signed-off-by: YueHaibing <[email protected]>

Thank you for an update, I have a comment below, but before sending v3, let
Rafael to have a chance to look at it.

> #ifdef CONFIG_ACPI
> extern int acpi_platform_notify(struct device *dev, enum kobject_action action);
> +
> +static inline void put_acpi_device(struct acpi_device *adev)
> +{
> + put_device(&adev->dev);
> +}

This should probably go to acpi_bus.h under acpi_dev_get_first_match_dev().
And talking to Mika we agreed that naming would be better as acpi_dev_put().

--
With Best Regards,
Andy Shevchenko


2019-04-11 23:17:30

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v2] gpio: merrifield: Fix build err without CONFIG_ACPI

On Friday, April 5, 2019 4:50:09 PM CEST Andy Shevchenko wrote:
> On Fri, Apr 05, 2019 at 10:21:12PM +0800, Yue Haibing wrote:
> > From: YueHaibing <[email protected]>
> >
> > When building CONFIG_ACPI is not set
> > gcc warn this:
> >
> > drivers/gpio/gpio-merrifield.c: In function
> > mrfld_gpio_get_pinctrl_dev_name: drivers/gpio/gpio-merrifield.c:388:19:
> > error: dereferencing pointer to incomplete type struct acpi_device>
> > put_device(&adev->dev);
> >
> > ^
> >
> > Reported-by: Hulk Robot <[email protected]>
> > Suggested-by: Andy Shevchenko <[email protected]>
> > Fixes:d00d2109c367 ("gpio: merrifield: Convert to use
> > acpi_dev_get_first_match_dev()") Signed-off-by: YueHaibing
> > <[email protected]>
>
> Thank you for an update, I have a comment below, but before sending v3, let
> Rafael to have a chance to look at it.
>
> > #ifdef CONFIG_ACPI
> > extern int acpi_platform_notify(struct device *dev, enum kobject_action
> > action);>
> > +
> > +static inline void put_acpi_device(struct acpi_device *adev)
> > +{
> > + put_device(&adev->dev);
> > +}
>
> This should probably go to acpi_bus.h under acpi_dev_get_first_match_dev().
> And talking to Mika we agreed that naming would be better as acpi_dev_put().

Agreed on both accounts.

Thanks!




2019-04-12 13:14:24

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2] gpio: merrifield: Fix build err without CONFIG_ACPI

On Fri, Apr 12, 2019 at 3:55 AM Rafael J. Wysocki <[email protected]> wrote:
> On Friday, April 5, 2019 4:50:09 PM CEST Andy Shevchenko wrote:
> > On Fri, Apr 05, 2019 at 10:21:12PM +0800, Yue Haibing wrote:
> > > From: YueHaibing <[email protected]>
> > >
> > > When building CONFIG_ACPI is not set
> > > gcc warn this:
> > >
> > > drivers/gpio/gpio-merrifield.c: In function
> > > mrfld_gpio_get_pinctrl_dev_name: drivers/gpio/gpio-merrifield.c:388:19:
> > > error: dereferencing pointer to incomplete type struct acpi_device>
> > > put_device(&adev->dev);
> > >
> > > ^
> > >
> > > Reported-by: Hulk Robot <[email protected]>
> > > Suggested-by: Andy Shevchenko <[email protected]>
> > > Fixes:d00d2109c367 ("gpio: merrifield: Convert to use
> > > acpi_dev_get_first_match_dev()") Signed-off-by: YueHaibing
> > > <[email protected]>
> >
> > Thank you for an update, I have a comment below, but before sending v3, let
> > Rafael to have a chance to look at it.
> >
> > > #ifdef CONFIG_ACPI
> > > extern int acpi_platform_notify(struct device *dev, enum kobject_action
> > > action);>
> > > +
> > > +static inline void put_acpi_device(struct acpi_device *adev)
> > > +{
> > > + put_device(&adev->dev);
> > > +}
> >
> > This should probably go to acpi_bus.h under acpi_dev_get_first_match_dev().
> > And talking to Mika we agreed that naming would be better as acpi_dev_put().
>
> Agreed on both accounts.

Thanks!
YueHaibing, please, send v3 with suggested changes.

--
With Best Regards,
Andy Shevchenko

2019-04-12 13:27:52

by Yue Haibing

[permalink] [raw]
Subject: Re: [PATCH v2] gpio: merrifield: Fix build err without CONFIG_ACPI

On 2019/4/12 21:13, Andy Shevchenko wrote:
> On Fri, Apr 12, 2019 at 3:55 AM Rafael J. Wysocki <[email protected]> wrote:
>> On Friday, April 5, 2019 4:50:09 PM CEST Andy Shevchenko wrote:
>>> On Fri, Apr 05, 2019 at 10:21:12PM +0800, Yue Haibing wrote:
>>>> From: YueHaibing <[email protected]>
>>>>
>>>> When building CONFIG_ACPI is not set
>>>> gcc warn this:
>>>>
>>>> drivers/gpio/gpio-merrifield.c: In function
>>>> mrfld_gpio_get_pinctrl_dev_name: drivers/gpio/gpio-merrifield.c:388:19:
>>>> error: dereferencing pointer to incomplete type struct acpi_device>
>>>> put_device(&adev->dev);
>>>>
>>>> ^
>>>>
>>>> Reported-by: Hulk Robot <[email protected]>
>>>> Suggested-by: Andy Shevchenko <[email protected]>
>>>> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use
>>>> acpi_dev_get_first_match_dev()") Signed-off-by: YueHaibing
>>>> <[email protected]>
>>>
>>> Thank you for an update, I have a comment below, but before sending v3, let
>>> Rafael to have a chance to look at it.
>>>
>>>> #ifdef CONFIG_ACPI
>>>> extern int acpi_platform_notify(struct device *dev, enum kobject_action
>>>> action);>
>>>> +
>>>> +static inline void put_acpi_device(struct acpi_device *adev)
>>>> +{
>>>> + put_device(&adev->dev);
>>>> +}
>>>
>>> This should probably go to acpi_bus.h under acpi_dev_get_first_match_dev().
>>> And talking to Mika we agreed that naming would be better as acpi_dev_put().
>>
>> Agreed on both accounts.
>
> Thanks!
> YueHaibing, please, send v3 with suggested changes.

Ok.

>

2019-04-12 15:21:39

by Yue Haibing

[permalink] [raw]
Subject: [PATCH v3] gpio: merrifield: Fix build err without CONFIG_ACPI

From: YueHaibing <[email protected]>

When building CONFIG_ACPI is not set
gcc warn this:

drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
put_device(&adev->dev);
^~

Reported-by: Hulk Robot <[email protected]>
Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
Suggested-by: Andy Shevchenko <[email protected]>
Signed-off-by: YueHaibing <[email protected]>
---
v3: move helper to acpi_bus.h, and change name to acpi_dev_put
---
drivers/gpio/gpio-merrifield.c | 2 +-
include/acpi/acpi_bus.h | 4 ++++
include/linux/acpi.h | 2 ++
3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
index 2383dc7..3302125 100644
--- a/drivers/gpio/gpio-merrifield.c
+++ b/drivers/gpio/gpio-merrifield.c
@@ -385,7 +385,7 @@ static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
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);
+ acpi_dev_put(adev);
} else {
name = "pinctrl-merrifield";
}
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index f798175..2a462cf 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -687,6 +687,10 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set);
}

+static inline void acpi_dev_put(struct acpi_device *adev)
+{
+ put_device(&adev->dev);
+}
#else /* CONFIG_ACPI */

static inline int register_acpi_bus_type(void *bus) { return 0; }
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index a1bd789..e22c237 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -679,6 +679,8 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
return NULL;
}

+static inline void acpi_dev_put(struct acpi_device *adev) {}
+
static inline bool is_acpi_node(struct fwnode_handle *fwnode)
{
return false;
--
2.7.4


2019-04-12 17:57:10

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3] gpio: merrifield: Fix build err without CONFIG_ACPI

On Fri, Apr 12, 2019 at 11:19:11PM +0800, Yue Haibing wrote:
> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^~
>

Thank you.
Reviewed-by: Andy Shevchenko <[email protected]>

> Reported-by: Hulk Robot <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Suggested-by: Andy Shevchenko <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>
> ---
> v3: move helper to acpi_bus.h, and change name to acpi_dev_put
> ---
> drivers/gpio/gpio-merrifield.c | 2 +-
> include/acpi/acpi_bus.h | 4 ++++
> include/linux/acpi.h | 2 ++
> 3 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c
> index 2383dc7..3302125 100644
> --- a/drivers/gpio/gpio-merrifield.c
> +++ b/drivers/gpio/gpio-merrifield.c
> @@ -385,7 +385,7 @@ static const char *mrfld_gpio_get_pinctrl_dev_name(struct mrfld_gpio *priv)
> 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);
> + acpi_dev_put(adev);
> } else {
> name = "pinctrl-merrifield";
> }
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index f798175..2a462cf 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -687,6 +687,10 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
> adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set);
> }
>
> +static inline void acpi_dev_put(struct acpi_device *adev)
> +{
> + put_device(&adev->dev);
> +}
> #else /* CONFIG_ACPI */
>
> static inline int register_acpi_bus_type(void *bus) { return 0; }
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index a1bd789..e22c237 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -679,6 +679,8 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
> return NULL;
> }
>
> +static inline void acpi_dev_put(struct acpi_device *adev) {}
> +
> static inline bool is_acpi_node(struct fwnode_handle *fwnode)
> {
> return false;
> --
> 2.7.4
>
>

--
With Best Regards,
Andy Shevchenko


2019-04-23 09:20:13

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH v3] gpio: merrifield: Fix build err without CONFIG_ACPI

On Fri, Apr 12, 2019 at 5:20 PM Yue Haibing <[email protected]> wrote:

> From: YueHaibing <[email protected]>
>
> When building CONFIG_ACPI is not set
> gcc warn this:
>
> drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> put_device(&adev->dev);
> ^~
>
> Reported-by: Hulk Robot <[email protected]>
> Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> Suggested-by: Andy Shevchenko <[email protected]>
> Signed-off-by: YueHaibing <[email protected]>

This doesn't apply cleanly to any GPIO branch (devel or fixes)
so I assume it is supposed to be applied to the ACPI tree.
Acked-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2019-04-26 12:25:43

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3] gpio: merrifield: Fix build err without CONFIG_ACPI

On Tue, Apr 23, 2019 at 11:17:32AM +0200, Linus Walleij wrote:
> On Fri, Apr 12, 2019 at 5:20 PM Yue Haibing <[email protected]> wrote:
>
> > From: YueHaibing <[email protected]>
> >
> > When building CONFIG_ACPI is not set
> > gcc warn this:
> >
> > drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> > drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> > put_device(&adev->dev);
> > ^~
> >
> > Reported-by: Hulk Robot <[email protected]>
> > Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> > Suggested-by: Andy Shevchenko <[email protected]>
> > Signed-off-by: YueHaibing <[email protected]>
>
> This doesn't apply cleanly to any GPIO branch (devel or fixes)
> so I assume it is supposed to be applied to the ACPI tree.
> Acked-by: Linus Walleij <[email protected]>

Thanks!
Rafael, can this be applied to your tree?

--
With Best Regards,
Andy Shevchenko


2019-04-29 08:41:51

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH v3] gpio: merrifield: Fix build err without CONFIG_ACPI

On Friday, April 26, 2019 2:23:17 PM CEST Andy Shevchenko wrote:
> On Tue, Apr 23, 2019 at 11:17:32AM +0200, Linus Walleij wrote:
> > On Fri, Apr 12, 2019 at 5:20 PM Yue Haibing <[email protected]> wrote:
> >
> > > From: YueHaibing <[email protected]>
> > >
> > > When building CONFIG_ACPI is not set
> > > gcc warn this:
> > >
> > > drivers/gpio/gpio-merrifield.c: In function mrfld_gpio_get_pinctrl_dev_name:
> > > drivers/gpio/gpio-merrifield.c:388:19: error: dereferencing pointer to incomplete type struct acpi_device
> > > put_device(&adev->dev);
> > > ^~
> > >
> > > Reported-by: Hulk Robot <[email protected]>
> > > Fixes:d00d2109c367 ("gpio: merrifield: Convert to use acpi_dev_get_first_match_dev()")
> > > Suggested-by: Andy Shevchenko <[email protected]>
> > > Signed-off-by: YueHaibing <[email protected]>
> >
> > This doesn't apply cleanly to any GPIO branch (devel or fixes)
> > so I assume it is supposed to be applied to the ACPI tree.
> > Acked-by: Linus Walleij <[email protected]>
>
> Thanks!
> Rafael, can this be applied to your tree?

Done already, thanks!