linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Subject: [PATCH] at24: make module parameters changeable via sysfs
Date: Wed, 12 Sep 2012 11:43:32 +0200	[thread overview]
Message-ID: <1347443012-21302-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)

The respective values are evaluated at each read/write, so no further
action is required than to change the perm argument to module_param.

Note there is no sanity check so root can make the driver effectively
unusable but that's what root is for :-)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/misc/eeprom/at24.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index ab1ad41..8a5a192 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -85,7 +85,7 @@ struct at24_data {
  * This value is forced to be a power of two so that writes align on pages.
  */
 static unsigned io_limit = 128;
-module_param(io_limit, uint, 0);
+module_param(io_limit, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(io_limit, "Maximum bytes per I/O (default 128)");
 
 /*
@@ -93,7 +93,7 @@ MODULE_PARM_DESC(io_limit, "Maximum bytes per I/O (default 128)");
  * it's important to recover from write timeouts.
  */
 static unsigned write_timeout = 25;
-module_param(write_timeout, uint, 0);
+module_param(write_timeout, uint, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(write_timeout, "Time (in ms) to try writes (default 25)");
 
 #define AT24_SIZE_BYTELEN 5
-- 
1.7.10.4

             reply	other threads:[~2012-09-12  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  9:43 Uwe Kleine-König [this message]
     [not found] ` <1347443012-21302-1-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-09-14  8:25   ` [PATCH] at24: make module parameters changeable via sysfs Jean Delvare
     [not found]     ` <20120914102536.1ebd248d-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-18 11:53       ` Jean Delvare
     [not found]         ` <20121218125315.5adb1fef-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-12-18 11:59           ` Wolfram Sang
     [not found]             ` <20121218115926.GD2612-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-12-18 12:10               ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347443012-21302-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).