Looks almost good to me now. Some more details (only the -EFAULT return code
is a real issue, the other ones are cosmetic changes):
On Thursday 17 June 2010, Masayuki Ohtak wrote:
I'd recommend just getting rid of these abstractions. You only use
them in one or two functions each, so you can just as well add a local
variable there and do
void __iomem *p = pch_phub_reg.pch_phub_base_address;
foo = ioread32(p + foo_offset);
bar = ioread32(p + bar_offset);
...
Not really important, but this way it would be more conventional
without having to write extra code.
It would be better to drop the _t postfix on the type name.
By convention, we use this only for typedefs on simple data
types like off_t but not for structures.
When I told you to change the ioctl arguments to use __u32 instead
of u32, I was only referring to those parts that are in the user-visible
section of the header file. While it does not hurt to use __u32 in
the kernel, you should understand the distinction.
No need to make data static.
You should return -EFAULT if the get_user() call fails, otherwise you have
a possible security hole. If pch_phub_write_serial_rom fails, the correct
return code would be -EIO.
If would be good to add a line of
.llseek = default_llseek,
here. I have a patch to change the default llseek method to one
that disallows seeking, so if you add this line, there is one
less driver for me to patch.
Arnd
--