[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9e4733910711040539h5714faeeq6a9985fa5a63963@mail.gmail.com>
Date: Sun, 4 Nov 2007 08:39:49 -0500
From: "Jon Smirl" <jonsmirl@...il.com>
To: "Jean Delvare" <khali@...ux-fr.org>
Cc: lkml <linux-kernel@...r.kernel.org>, i2c@...sensors.org
Subject: Re: [i2c] [PATCH] Fix i2c module parameter permissions for read/write
On 11/4/07, Jean Delvare <khali@...ux-fr.org> wrote:
> Hi John,
>
> On Sun, 4 Nov 2007 00:55:15 -0400, Jon Smirl wrote:
> > The permissions of i2c module parameters were set to zero making the
> > parameters invisible and unsettable from the kernel command line. This
> > patch changes the permissions to the standard 0644 read/write.
>
> These permissions have nothing to do with the kernel command line. They
> define whether a file is created in sysfs for the respective module
> parameter. Even with permissions set to 0, you can still set the value
> in question from the kernel command line with <module>.<parm>=<value>.
I figured out later by inserting printks into the driver that they
were being set from the command line, but without changing the
permissions there was no way to read them to verify. The permissions
should at least be set to 0444 to allow them to be read.
IMHO the I2C_CLIENT_INSMOD macros could use some rework since they use
side effects to set variables without being explicit about it.
The real problem was unrelated to this, it was an off by one error in
the i2c bus numbering code of my embedded processor. That made the
parameters not work since I was setting them on a different bus.
Changed to 0444.
Signed-off-by: Jon Smirl <jonsmirl@...il.com>
---
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 8033e6b..395e430 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -588,7 +588,7 @@ union i2c_smbus_data {
#define I2C_CLIENT_MODULE_PARM(var,desc) \
static unsigned short var[I2C_CLIENT_MAX_OPTS] = I2C_CLIENT_DEFAULTS; \
static unsigned int var##_num; \
- module_param_array(var, short, &var##_num, 0); \
+ module_param_array(var, short, &var##_num, 0444); \
MODULE_PARM_DESC(var,desc)
#define I2C_CLIENT_MODULE_PARM_FORCE(name) \
--
Jon Smirl
jonsmirl@...il.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists