[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110518162139.GA11027@ponder.secretlab.ca>
Date: Wed, 18 May 2011 10:21:39 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: Josip Rodin <joy@...uzijast.net>
Cc: Milton Miller <miltonm@....com>,
David Miller <davem@...emloft.net>,
devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
sparclinux@...r.kernel.org
Subject: Re: [PATCH] of: fix race when matching drivers
On Wed, May 18, 2011 at 05:45:17PM +0200, Josip Rodin wrote:
> On Wed, May 18, 2011 at 10:27:39AM -0500, Milton Miller wrote:
> > --- work.git.orig/include/linux/of_device.h 2011-05-18 09:57:01.014386816 -0500
> > +++ work.git/include/linux/of_device.h 2011-05-18 09:58:27.537431575 -0500
> > @@ -21,8 +21,15 @@ extern void of_device_make_bus_id(struct
> > static inline int of_driver_match_device(struct device *dev,
> > const struct device_driver *drv)
> > {
> > - dev->of_match = of_match_device(drv->of_match_table, dev);
> > - return dev->of_match != NULL;
> > + const struct of_device_id *match;
> > +
> > + match = of_match_device(drv->of_match_table, dev);
> > + if (match) {
> > + dev->of_match = of_match_device(drv->of_match_table, dev);
> > + return 1;
> > + }
> > +
> > + return 0;
> > }
>
> Err, is there some reason to avoid simply assigning the existing result:
> dev->of_match = match; ?
Good point. I've committed and am currently testing the modified version.
g.
--
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