Re: [PATCH 4/8] RTC subsystem, proc interface

From: Dmitry Torokhov
Date: Sun Jan 08 2006 - 21:49:43 EST


On Sunday 08 January 2006 21:04, Alessandro Zummo wrote:
> On Sun, 8 Jan 2006 20:56:29 -0500
> Dmitry Torokhov <dtor_core@xxxxxxxxxxxxx> wrote:
>
> > > +static void rtc_proc_remove_device(struct class_device *class_dev,
> > > +                                             struct class_interface *class_intf)
> > > +{
> > > +       down(&rtc_sem);
> > > +       if (rtc_dev == class_dev) {
> > > +               remove_proc_entry("driver/rtc", NULL);
> > > +               rtc_dev = NULL;
> > > +       }
> > > +       up(&rtc_sem);
> > > +}
> >
> > What if I happen to remove (unregister) rtc devices in order other
> > than they were registered in? You need a counter there instead of
> > storing the first device created.
>
> Only the first device that registers will get the /proc/driver/rtc
> entry, which will be removed when the driver unregisters.
>
> /proc/driver/rtc is a legacy interface, thus supporting it
> for more than one RTC is useless. Any system that uses
> more than one RTCs should access them via /dev/rtcX or
> via sysfs.
>

Oh, I see. Ignore me then...

--
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/