Re: [RFC][PATCH 7/7] RTC subsystem, test device/driver

From: Dmitry Torokhov
Date: Mon Dec 26 2005 - 18:44:28 EST


On Monday 26 December 2005 13:59, Alessandro Zummo wrote:
> +struct platform_device test_dev_zero = {
> + .name = "rtc-test",
> + .id = 0,
> + .dev.release = test_release,
> +};
> +
> +struct platform_device test_dev_one = {
> + .name = "rtc-test",
> + .id = 1,
> + .dev.release = test_release,
> +};
> +

You should never ever statically allicate devices that can be unregistered.
Guess what will happen if one does this:

rmmod rtc_test < /sys/class/rtc/rtcX/date

where rctX is class device created by rtc-test0 or rtc-test1.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/