* class_device_create() and the mode of the device file in /dev.
@ 2007-05-22 22:49 Y Khan
2007-05-23 3:46 ` Kay Sievers
0 siblings, 1 reply; 3+ messages in thread
From: Y Khan @ 2007-05-22 22:49 UTC (permalink / raw)
To: linux-kernel
Hi All,
I am porting a driver from 2.4 to 2.6. I have replaced
the call devfs_register() with class_create() and
class_device_create(). Now, udev is automatically
creating the device file in /dev.
The device file being created has a default mode of
0600. Is it possible to override this default mode
from inside the kernel. I do not want to do anything
in the configuration file for udev.
I could modify the attribute of the class and the
class device but I do not think that they will change
the default permissions for the /dev device file.
devfs_register() used to take a mode argument.
So, is there anyway of achieving this in 2.6.
-Y
____________________________________________________________________________________Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: class_device_create() and the mode of the device file in /dev.
2007-05-22 22:49 class_device_create() and the mode of the device file in /dev Y Khan
@ 2007-05-23 3:46 ` Kay Sievers
2007-05-23 23:29 ` Y Khan
0 siblings, 1 reply; 3+ messages in thread
From: Kay Sievers @ 2007-05-23 3:46 UTC (permalink / raw)
To: Y Khan; +Cc: linux-kernel
On 5/23/07, Y Khan <ykhanportland@yahoo.com> wrote:
> I am porting a driver from 2.4 to 2.6. I have replaced
> the call devfs_register() with class_create() and
> class_device_create(). Now, udev is automatically
> creating the device file in /dev.
Please use device_create(), class_device_* will go away in the future.
> The device file being created has a default mode of
> 0600. Is it possible to override this default mode
> from inside the kernel. I do not want to do anything
> in the configuration file for udev.
>
> I could modify the attribute of the class and the
> class device but I do not think that they will change
> the default permissions for the /dev device file.
>
> devfs_register() used to take a mode argument.
No, the kernel is not involved in specifying /dev permissions. You
have to add a udev rule to assign a mode that isn't the default.
Thanks,
Kay
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: class_device_create() and the mode of the device file in /dev.
2007-05-23 3:46 ` Kay Sievers
@ 2007-05-23 23:29 ` Y Khan
0 siblings, 0 replies; 3+ messages in thread
From: Y Khan @ 2007-05-23 23:29 UTC (permalink / raw)
To: linux-kernel
>
> No, the kernel is not involved in specifying /dev
> permissions. You
> have to add a udev rule to assign a mode that isn't
> the default.
>
Hmm...When I can create the device file automatically
then I should also be able to specify the mode. udev
can override this value from kernel if it has another
value from the user. But not having this capability in
the kernel kind of distributes the work (part 1 done
in kernel while part 2 done in user space), which is
not very friendly. Now I will have to distribute a
udev conf file along with my driver.
I can make changes to udev/kernel for this if people
think that this is also desired by others.
-Y
____________________________________________________________________________________You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-23 23:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22 22:49 class_device_create() and the mode of the device file in /dev Y Khan
2007-05-23 3:46 ` Kay Sievers
2007-05-23 23:29 ` Y Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox