[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1202339114.6162.17.camel@localhost.localdomain>
Date: Wed, 06 Feb 2008 23:05:14 +0000
From: Adrian McMenamin <adrian@...golddream.dyndns.info>
To: Greg KH <greg@...ah.com>
Cc: Paul Mundt <lethal@...rs.sourceforge.net>,
LKML <linux-kernel@...r.kernel.org>,
linux-sh <linux-sh@...r.kernel.org>
Subject: Re: [PATCH 2/2] - SH/Dreamcast - fix maple bus bugs
On Wed, 2008-02-06 at 15:01 -0800, Greg KH wrote:
> On Wed, Feb 06, 2008 at 10:53:51PM +0000, Adrian McMenamin wrote:
> > - dev->function = function;
> > - dev->dev.bus = &maple_bus_type;
> > - dev->dev.parent = &maple_bus;
> > - dev->dev.release = &maple_release_device;
> > - retval = device_register(&dev->dev);
> > - if (retval) {
> > - printk(KERN_INFO
> > - "Maple bus: Attempt to register device (%x, %x) failed.\n",
> > - dev->port, dev->unit);
> > - maple_free_dev(dev);
> > + mdev->function = function;
> > + mdev->dev.release = &maple_release_device;
> > + if (mdev->registered == 0) {
> > + retval = device_register(&mdev->dev);
> > + if (retval) {
> > + printk(KERN_INFO
> > + "Maple bus: Attempt to register device"
> > + " (%x, %x) failed.\n",
> > + mdev->port, mdev->unit);
> > + maple_free_dev(mdev);
> > + mdev = NULL;
> > + return;
> > + }
> > + mdev->registered = 1;
> > }
> > - dev->registered = 1;
>
> I think you are still papering over the real problem here of trying to
> register a device twice. That's something you should never be doing,
> and your bus walking logic must be incorrect...
>
I just left that in as a sanity check. It should never be acted on. I
can remove it if you prefer.
--
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