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  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:	Thu, 15 Dec 2011 10:10:47 +0800
From:	Shawn Guo <shawn.guo@...escale.com>
To:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
CC:	<linux-kernel@...r.kernel.org>, <kernel@...gutronix.de>,
	<linux-arm-kernel@...ts.infradead.org>,
	Shawn Guo <shawn.guo@...aro.org>,
	Alan Cox <alan@...ux.intel.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Jeremy Kerr <jeremy.kerr@...onical.com>,
	Jason Liu <jason.hui@...aro.org>,
	Sascha Hauer <s.hauer@...gutronix.de>
Subject: Re: [PATCH] serial/imx: propagate error from of_alias_get_id instead
 of using -ENODEV

On Wed, Dec 14, 2011 at 09:31:53PM +0100, Uwe Kleine-König wrote:
> Hello,
> 
> On Wed, Dec 14, 2011 at 09:26:51PM +0100, Uwe Kleine-König wrote:
> > A quick look at of_alias_get_id shows that in the error case it returns
> > -ENODEV, too, but still it's better style to propagate the value as is.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> > Cc: Shawn Guo <shawn.guo@...aro.org>
> > Cc: Alan Cox <alan@...ux.intel.com>
> > Cc: Grant Likely <grant.likely@...retlab.ca>
> > Cc: Jeremy Kerr <jeremy.kerr@...onical.com>
> > Cc: Jason Liu <jason.hui@...aro.org>
> > Cc: Sascha Hauer <s.hauer@...gutronix.de>
> > ---
> >  drivers/tty/serial/imx.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> > index 163fc90..75c159a 100644
> > --- a/drivers/tty/serial/imx.c
> > +++ b/drivers/tty/serial/imx.c
> > @@ -1301,7 +1301,7 @@ static int serial_imx_probe_dt(struct imx_port *sport,
> >  	ret = of_alias_get_id(np, "serial");
> >  	if (ret < 0) {
> >  		dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
> > -		return -ENODEV;
> > +		return ret;
> >  	}
> >  	sport->port.line = ret;
> >  
> One more comment on serial_imx_probe_dt:
> 
> It is used as follows:
> 
>         ret = serial_imx_probe_dt(sport, pdev);
> 	if (ret == -ENODEV)
> 		serial_imx_probe_pdata(sport, pdev);
> 
> IMHO you should distinguish here more carefully between the different
> -ENODEV cases. It's OK to call serial_imx_probe_pdata() if
> 
> 	!pdev->dev.of_node
> 
> but if
> 
> 	of_alias_get_id(np, "serial")
> 
> returns an error isn't that something that should make the probing of
> the device fail instead of relying on platform data and the device id
> that are non-existant and more or less random respectively if the device
> is instantiated by dt?
> 
Yes, agreed.  Care to send a fix for that too?

-- 
Regards,
Shawn

--
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