lkml.org 
[lkml]   [2015]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH 3/8] mfd: cros_ec: Instantiate sub-devices from device tree
Hello Lee,

On 05/05/2015 12:53 PM, Lee Jones wrote:
> On Tue, 05 May 2015, Javier Martinez Canillas wrote:
>> >> };
>> >>
>> >> @@ -150,6 +141,15 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
>> >> return err;
>> >> }
>> >>
>> >> +#ifdef CONFIG_OF
>> >> + err = of_platform_populate(dev->of_node, NULL, NULL, dev);
>> >> + if (err) {
>> >> + mfd_remove_devices(dev);
>> >> + dev_err(dev, "Failed to register sub-devices\n");
>> >> + return err;
>> >> + }
>> >> +#endif
>> >
>> > And if we don't support OF?
>> >
>>
>> These sub-devices are only present on machines that support OF so
>> is more flexible to use of_platform_populate() to register those.
>>
>> Both machines using and not using DT, register a cros-ec-ctl which
>> is still a mfd_cell in the cros_devs array.
>
> I'm not really a fan of #ifdiffery if it can be avoided.
>
> How about?
>
> if (np)
> cros_ec_of_register();
>

Works for me, I'll change it to avoid the ifdeffery.

Best regards,
Javier


\
 
 \ /
  Last update: 2015-05-05 13:41    [W:0.058 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site