[MIPS] PNX8550: Cleanup proc code.

Here's a slightly cleaner way of creating the /proc structure for the
pnx8850.  mostly, it creates a directory with default mode 555, since the
one you're creating is mode 444, which is somewhat unusual for a directory
under /proc.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Robert P. J. Day 2007-07-10 06:37:56 -04:00 committed by Ralf Baechle
parent 569fb7536e
commit 105b1bca4d
1 changed files with 17 additions and 13 deletions

View File

@ -78,29 +78,33 @@ static int pnx8550_proc_init( void )
{ {
// Create /proc/pnx8550 // Create /proc/pnx8550
pnx8550_dir = create_proc_entry("pnx8550", S_IFDIR|S_IRUGO, NULL); pnx8550_dir = proc_mkdir("pnx8550", NULL);
if (!pnx8550_dir) { if (!pnx8550_dir) {
printk(KERN_ERR "Can't create pnx8550 proc dir\n"); printk(KERN_ERR "Can't create pnx8550 proc dir\n");
return -1; return -1;
} }
// Create /proc/pnx8550/timers // Create /proc/pnx8550/timers
pnx8550_timers = create_proc_entry("timers", S_IFREG|S_IRUGO, pnx8550_dir ); pnx8550_timers = create_proc_read_entry(
if (pnx8550_timers){ "timers",
pnx8550_timers->read_proc = pnx8550_timers_read; 0,
} pnx8550_dir,
else { pnx8550_timers_read,
NULL);
if (!pnx8550_timers)
printk(KERN_ERR "Can't create pnx8550 timers proc file\n"); printk(KERN_ERR "Can't create pnx8550 timers proc file\n");
}
// Create /proc/pnx8550/registers // Create /proc/pnx8550/registers
pnx8550_registers = create_proc_entry("registers", S_IFREG|S_IRUGO, pnx8550_dir ); pnx8550_registers = create_proc_read_entry(
if (pnx8550_registers){ "registers",
pnx8550_registers->read_proc = pnx8550_registers_read; 0,
} pnx8550_dir,
else { pnx8550_registers_read,
NULL);
if (!pnx8550_registers)
printk(KERN_ERR "Can't create pnx8550 registers proc file\n"); printk(KERN_ERR "Can't create pnx8550 registers proc file\n");
}
return 0; return 0;
} }