Re: [PATCH] eeepc-laptop: remove disp attribute show function

Darren Hart
2014-09-08T23:32:31Z

On Mon, Sep 08, 2014 at 02:57:23PM -0700, Greg Kroah-Hartman wrote:
> On Mon, Sep 08, 2014 at 11:44:38PM +0200, Frans Klaver wrote:
> > On Mon, Sep 08, 2014 at 11:23:06PM +0200, Frans Klaver wrote:
> > > On Mon, Sep 08, 2014 at 02:16:27PM -0700, Greg Kroah-Hartman wrote:
> > > > On Mon, Sep 08, 2014 at 11:12:42PM +0200, Frans Klaver wrote:
> > > > >
> > > > > EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA);
> > > > > EEEPC_CREATE_DEVICE_ATTR(cardr, 0644, CM_ASL_CARDREADER);
> > > > > -EEEPC_CREATE_DEVICE_ATTR(disp, 0200, CM_ASL_DISPLAYSWITCH);
> > > > > +
> > > > > +static ssize_t store_disp(struct device *dev,
> > > > > + struct device_attribute *attr,
> > > > > + const char *buf, size_t count)
> > > > > +{
> > > > > + return store_sys_acpi(dev, CM_ASL_DISPLAYSWITCH, buf, count);
> > > > > +}
> > > > > +
> > > > > +static struct device_attribute dev_attr_disp = {
> > > > > + .attr = {
> > > > > + .name = "disp",
> > > > > + .mode = 0200 },
> > > > > + .store = store_disp,
> > > > > +};
> > > >
> > > > DEVICE_ATTR()?
> > >
> > > That would make sense, wouldn't it? The only defense I have is that it
> > > isn't used in EEEPC_CREATE_DEVICE_ATTR() either.
> >
> > I might as well fix that as well, and the fact that the octal
> > permissions are used instead of S_IRUGO and friends. Would you prefer
> > that in a separate patch?

If you're offering to fix it (thanks!), please do any necessary cleanup first
(like switching to S_IRUGO and friends), and then follow up with a DEVICE_ATTR
solution.

Thanks,

--
Darren Hart
Intel Open Source Technology Center