[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201110181605.12512.arnd@arndb.de>
Date: Tue, 18 Oct 2011 16:05:12 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Lee Jones <lee.jones@...aro.org>
Cc: Greg KH <gregkh@...e.de>, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linus.walleij@...ricsson.com,
jamie@...ieiles.com
Subject: Re: [PATCH 2/6] drivers/base: add bus for System-on-Chip devices
On Tuesday 18 October 2011, Lee Jones wrote:
> On 17/10/11 17:18, Greg KH wrote:
> > On Mon, Oct 17, 2011 at 12:52:54PM +0100, Lee Jones wrote:
> >> +{
> >> + struct soc_device *soc_dev =
> >> + container_of(dev, struct soc_device, dev);
> >> +
> >> + sysfs_remove_group(&dev->kobj, &soc_attr_group);
> >> +
> >> + if (device_is_registered(dev))
> >> + device_unregister(dev);
> >
> > Why is this call needed?
>
> To unregister a previously unregistered device?
>
> Is that wrong?
See Jamie's excellent explanation: you don't need to check
for device_is_registered() here, but just call device_unregister
unconditionally.
> >> +
> >> + bus_unregister(&soc_bus_type);
> >
> > What happens if you have more than one SOC device? I think you just
> > oopsed.
>
> I think you're right.
>
> When to you suggest we unregister the bus?
Do it in the same way as registering it, as a module_exit() function
below the initcall that instantiates it. These interfaces usually come
in pairs, so if something does not look symmetric, you should better
have another look.
Arnd
--
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