Re: [PATCH 4/4] Input: auo_pixcir_ts - add devicetree support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitry,

Am Sonntag, 24. Februar 2013, 09:00:15 schrieb Dmitry Torokhov:
> Hi Heiko,
> 
> On Sat, Feb 23, 2013 at 12:58:16PM +0100, Heiko Stübner wrote:
> > +static struct auo_pixcir_ts_platdata *auo_pixcir_parse_dt(struct device
> > *dev) +{
> > +	struct auo_pixcir_ts_platdata *pdata = NULL;
> > +
> > +#ifdef CONFIG_OF
> > +	struct device_node *np = dev->of_node;
> > +
> > +	if (!np)
> > +		return NULL;
> > +
> > +	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> > +	if (!pdata) {
> > +		dev_err(dev, "failed to allocate platform data\n");
> > +		return NULL;
> > +	}
> 
> I disike #ifdefs in the middle of the code, also it would be nice if we
> signal the proper error instead of always using -EINVAL when there are
> issues with platform/DT data.
> 
> How about the version of the patch below?

I tested it and everything of course still works :-) .

I have no real preference for one way or the other. I had seen both types in 
different drivers and could not really decide which I like better, so I'm fine 
with using your variant instead.


Thanks
Heiko
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux