Re: [PATCH v6 09/10] power: supply: Support ROHM bd99954 charger

From: Vaittinen, Matti
Date: Wed Mar 25 2020 - 07:36:56 EST


Hello Andy,

On Tue, 2020-03-24 at 12:35 +0200, Andy Shevchenko wrote:
> On Tue, Mar 24, 2020 at 11:50:24AM +0200, Andy Shevchenko wrote:
> > On Tue, Mar 24, 2020 at 10:32:19AM +0200, Matti Vaittinen wrote:
> > > +#include <linux/acpi.h>
> > > +#include <linux/of.h>
> >
> > I didn't find any evidence of use of those two, otherwise, missed
> > property.h
> > and perhaps mod_devicetable.h.
>
> ...
>
> > > +MODULE_DEVICE_TABLE(of, bd9995x_of_match);
> > > +MODULE_DEVICE_TABLE(acpi, bd9995x_acpi_match);
>
> I have to add since you are using those macros without ifdeffery, you
> should
> get warning in !ACPI and/or !OF cases.
>
> So, drop those of_match_ptr() / ACPI_PTR() and thus above headers.

Sorry but I don't follow :/ I did drop whole ACPI table as the battery
information is not fetched from ACPI anyways. But I don't know what you
mean by dropping the of_match_ptr? I for sure need the of_device_id as
in many cases both the device matching and module matching are done
based on of_match_table and of_device_id.

I admit I didn't try compiling the !OF config. Are you suggesting I
should put the of_device_id array and populating the of_match_table in
#ifdef CONFIG_OF? Or maybe you suggest that I will put of_device_id
array in #ifdef CONFIG_OF and use of_match_ptr() when populating the
of_match_table pointer? I guess that would make sense. I'll do that -
can you please explain if this was not what you meant.

Br,
Matti