[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111017161854.GB5108@suse.de>
Date: Mon, 17 Oct 2011 09:18:54 -0700
From: Greg KH <gregkh@...e.de>
To: Lee Jones <lee.jones@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linus.walleij@...ricsson.com, jamie@...ieiles.com, arnd@...db.de
Subject: Re: [PATCH 2/6] drivers/base: add bus for System-on-Chip devices
On Mon, Oct 17, 2011 at 12:52:54PM +0100, Lee Jones wrote:
> +void soc_device_unregister(struct device *dev)
Ick, no, pass in the struct soc_device, which the register function
should return, not a "raw" struct device.
> +{
> + 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?
> +
> + bus_unregister(&soc_bus_type);
What happens if you have more than one SOC device? I think you just
oopsed.
> +
> + kfree(soc_dev->attr);
> + kfree(soc_dev);
Nope, you just failed again. I can tell you never tried this code path,
otherwise you would have noticed the HUGE warnings that the kernel spit
back at you. Please fix this.
greg k-h
--
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