[PATCH dev-5.4 00/14] PECI device driver introduction

Jae Hyun Yoo jae.hyun.yoo at linux.intel.com
Wed Dec 18 19:01:03 AEDT 2019


Hi Joel,

On 12/17/2019 8:17 PM, Joel Stanley wrote:
> On Wed, 18 Dec 2019 at 03:08, Joel Stanley <joel at jms.id.au> wrote:
>>
>> On Wed, 18 Dec 2019 at 01:28, Jae Hyun Yoo <jae.hyun.yoo at linux.intel.com> wrote:
>>>
>>> I'm still trying to upstream it but it would take more time so I'm sending
>>> it to OpenBMC list to get cherry picked in the meantime.
>>>
>>> I rebased it on dev-5.4 branch and it includes fixes for addressing
>>> upstream review comments I've got so far.
>>>
>>> Below change should be removed from the OpenBMC linux tree before applying
>>> it to avoid conflicts:
>>>
>>> c31349b9039281107b948bf94ed5e53c235c8081 (ARM: dts: aspeed: peci: Add PECI node)
>>>
>>
>> Thanks. I have applied this to dev-5.4. Please test.
> 
> When CONFIG_OF_DYNAMIC=y we get this build failure:
> 
> ../drivers/peci/peci-core.c:1717:52: error: passing argument 4 of
> ‘bus_find_device’ from incompatible pointer type
> [-Werror=incompatible-pointer-types]
>   1717 |  dev = bus_find_device(&peci_bus_type, NULL, node, peci_of_match_node);
>        |                                                    ^~~~~~~~~~~~~~~~~~
>        |                                                    |
>        |                                                    int
> (*)(struct device *, void *)
> In file included from ../include/linux/node.h:18,
>                   from ../include/linux/cpu.h:17,
>                   from ../include/linux/of_device.h:5,
>                   from ../drivers/peci/peci-core.c:8:
> ../include/linux/device.h:176:16: note: expected ‘int (*)(struct
> device *, const void *)’ but argument is of type ‘int (*)(struct
> device *, void *)’
>    176 | struct device *bus_find_device(struct bus_type *bus, struct
> device *start,
>        |                ^~~~~~~~~~~~~~~
> ../drivers/peci/peci-core.c: In function ‘peci_of_find_adapter’:
> ../drivers/peci/peci-core.c:1734:52: error: passing argument 4 of
> ‘bus_find_device’ from incompatible pointer type
> [-Werror=incompatible-pointer-types]
>   1734 |  dev = bus_find_device(&peci_bus_type, NULL, node, peci_of_match_node);
>        |                                                    ^~~~~~~~~~~~~~~~~~
>        |                                                    |
>        |                                                    int
> (*)(struct device *, void *)
> In file included from ../include/linux/node.h:18,
>                   from ../include/linux/cpu.h:17,
>                   from ../include/linux/of_device.h:5,
>                   from ../drivers/peci/peci-core.c:8:
> ../include/linux/device.h:176:16: note: expected ‘int (*)(struct
> device *, const void *)’ but argument is of type ‘int (*)(struct
> device *, void *)’
>    176 | struct device *bus_find_device(struct bus_type *bus, struct
> device *start,
>        |                ^~~~~~~~~~~~~~~
> cc1: some warnings being treated as errors

I checked that bus_find_device() definition was changed in June
so building it using -Werror will treat this warning as an error.

I made a fix and checked that the warning can be resolved.
Please apply below fix to patch 03/14 in this series or let me know
if you need v2 patch.

Thanks,

Jae

diff --git a/drivers/peci/peci-core.c b/drivers/peci/peci-core.c
index 61a2a59a9fe4..9aedb74710e6 100644
--- a/drivers/peci/peci-core.c
+++ b/drivers/peci/peci-core.c
@@ -1703,7 +1703,7 @@ static void peci_of_register_devices(struct 
peci_adapter *adapter) { }
  #endif /* CONFIG_OF */

  #if IS_ENABLED(CONFIG_OF_DYNAMIC)
-static int peci_of_match_node(struct device *dev, void *data)
+static int peci_of_match_node(struct device *dev, const void *data)
  {
         return dev->of_node == data;
  }

> Additioanlly, the nuvoton device trees in dev-5.4 did not compile. I
> will send a patch for that.
> 
> Cheers,
> 
> Joel
> 


More information about the openbmc mailing list