lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 05 May 2015 12:57:47 +0200
From:	Javier Martinez Canillas <javier.martinez@...labora.co.uk>
To:	Lee Jones <lee.jones@...aro.org>
CC:	Olof Johansson <olof@...om.net>,
	Doug Anderson <dianders@...omium.org>,
	Bill Richardson <wfrichar@...omium.org>,
	Simon Glass <sjg@...gle.com>,
	Gwendal Grignou <gwendal@...gle.com>,
	Stephen Barber <smbarber@...omium.org>,
	Filipe Brandenburger <filbranden@...gle.com>,
	Todd Broch <tbroch@...omium.org>,
	linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ