Re: [PATCH 02/10] staging: unisys: add toolaction to sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-07-15 at 21:50 -0700, Greg KH wrote:
> On Tue, Jul 15, 2014 at 01:30:42PM -0400, Benjamin Romer wrote:
> All sysfs files need a Documentation/ABI/ entry.  As this isn't in the
> "real" part of the kernel yet, just create the entries in the unisys/
> subdir and then when it moves out, we can move them to the "right" place
> in the tree.
> 
> Can you redo this patch with that entry?
> 

Of course. I'll add an ABI-documentation file to our subdir with all of
the documentation as the first patch in my resubmission.

> How can this not be true?  I tried to follow the code here, but it's
> horrid, why is this assigned in a work queue and not when the module
> starts up?

I'm not sure of the history or original purpose for the delayed
initialization, and it also looks like there are two different ways
defined in separate files for the channel to be assigned an address, so
what's there now is definitely overcomplicated. In addition to the
initialization fix, I'll move the channel address function into this
file and remove the other files to simplify things further.

> > +		U8 toolAction;
> > +
> > +		visorchannel_read(ControlVm_channel,
> > +			offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL,
> > +				   ToolAction), &toolAction, sizeof(U8));
> > +		return scnprintf(buf, PAGE_SIZE, "%u\n", toolAction);
> > +	} else
> > +		return -ENODEV;
> > +}
> 
> Why would this sysfs file be created if there is not a device?  That's
> not how sysfs files work, it should only be present if the file has a
> value, and if not, it shouldn't be there.

I'll clean this up so that it works that way, and remove the extraneous
checks for the channel address. 

> Same goes for your other sysfs files in this patchset, you should never
> be return -ENODEV, you just shouldn't have created the file in the first
> place.  That makes your kernel code simpler, and hopefully, your
> userspace code easier too.

It will. :) I'll do a cleanup patch set first and then redo the proc
changeover set after that.

> thanks,
> 
> greg k-h

-- 
Ben Romer | Software Engineer |
Virtual Systems Development 

Unisys Corporation |  2476
Swedesford Rd |  Malvern, PA 19355
|  610-648-7140



_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux