On Dec 4, 2007 11:41 AM, Alessandro Zummo <[EMAIL PROTECTED]> wrote:
> On Tue, 4 Dec 2007 11:29:11 -0500 "Mike Frysinger" <[EMAIL PROTECTED]> wrote:
> > On Dec 4, 2007 11:26 AM, Alessandro Zummo <[EMAIL PROTECTED]> wrote:
> > > Bryan Wu <[EMAIL PROTECTED]> wrote:
> > >
> > >  Hi, I fannly got some time to review the patches. Seems ok, the
> > >  only question is...
> > >
> > > > static int bfin_irq_set_freq(struct device *dev, int freq)
> > > >  {
> > > > -     struct bfin_rtc *rtc = dev_get_drvdata(dev);
> > > >       stampit();
> > > > -     rtc->rtc_dev->irq_freq = freq;
> > > > -     return 0;
> > > > +     return -ENOTTY;
> > > >  }
> > >
> > >  .. why ENOTTY here?
> >
> > that's what the documentation says to do as does every other rtc driver ?
>
>  it should be EINVAL. at least it is wat rtc-cmos does when the value
>  is invalid.

the return of ENOTTY is to say "changing of freq isnt supported", not
that the value is invalid.  but i can get the same behavior by
deleting the function as the rtc-dev layer will take care of returning
ENOTTY.

so the behavior is for the RTC_IRQP_SET ioctl:
 - return ENOTTY if you cannot change freq
   - the rtc-dev layer will do this for you if you do not set irq_set_freq
 - return EINVAL if the requested freq is not within the capabilities
of the hardware

sound about right ?
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to