[RFC PATCH v2 2/2] drivers: mfd: vexpress: add Serial Power Controller (SPC) support

Lorenzo Pieralisi lorenzo.pieralisi at arm.com
Thu Jun 6 04:22:25 EST 2013


On Wed, Jun 05, 2013 at 07:08:33PM +0100, Jon Medhurst (Tixy) wrote:
> On Wed, 2013-06-05 at 12:46 +0100, Lorenzo Pieralisi wrote:
> [...]
> > +static const struct of_device_id vexpress_spc_ids[] __initconst = {
> > +	{ .compatible = "arm,vexpress-spc,v2p-ca15_a7" },
> > +	{ .compatible = "arm,vexpress-spc" },
> > +	{},
> > +};
> > +
> > +static int __init vexpress_spc_init(void)
> > +{
> > +	int ret;
> > +	struct device_node *node = of_find_matching_node(NULL,
> > +							 vexpress_spc_ids);
> 
> To allow for devices without an SPC we should check for !node here and
> bail out, otherwise we get an ugly message from the WARN_ON further
> down. I see this on RTSM, and multiplatform kernels would suffer this as
> well.
> 
> Even if the ugly warning wasn't there, it still seems cleaner to me to
> have a proper check for an absent spc node.

Absolutely, I will apply both fixes, thanks a lot for the review.

Lorenzo



More information about the devicetree-discuss mailing list