]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] constify rtc_class_ops: update drivers
authorDavid Brownell <david-b@pacbell.net>
Sun, 1 Oct 2006 06:28:17 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 1 Oct 2006 07:39:25 +0000 (00:39 -0700)
Update RTC framework so that drivers can constify their method tables, moving
them from ".data" to ".rodata".  Then update the drivers.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
24 files changed:
drivers/rtc/class.c
drivers/rtc/rtc-at91.c
drivers/rtc/rtc-dev.c
drivers/rtc/rtc-ds1307.c
drivers/rtc/rtc-ds1553.c
drivers/rtc/rtc-ds1672.c
drivers/rtc/rtc-ds1742.c
drivers/rtc/rtc-ep93xx.c
drivers/rtc/rtc-isl1208.c
drivers/rtc/rtc-m48t86.c
drivers/rtc/rtc-max6902.c
drivers/rtc/rtc-pcf8563.c
drivers/rtc/rtc-pcf8583.c
drivers/rtc/rtc-pl031.c
drivers/rtc/rtc-proc.c
drivers/rtc/rtc-rs5c348.c
drivers/rtc/rtc-rs5c372.c
drivers/rtc/rtc-s3c.c
drivers/rtc/rtc-sa1100.c
drivers/rtc/rtc-test.c
drivers/rtc/rtc-v3020.c
drivers/rtc/rtc-vr41xx.c
drivers/rtc/rtc-x1205.c
include/linux/rtc.h

index 306d600a764aef89092926d6c9feac8da5042a41..7a0d8ee2de9c9aa95f973b86dec3d5955d348798 100644 (file)
@@ -39,7 +39,7 @@ static void rtc_device_release(struct class_device *class_dev)
  * Returns the pointer to the new struct class device.
  */
 struct rtc_device *rtc_device_register(const char *name, struct device *dev,
-                                       struct rtc_class_ops *ops,
+                                       const struct rtc_class_ops *ops,
                                        struct module *owner)
 {
        struct rtc_device *rtc;
index dfd0ce86f6a0d82e445752653e667899959d22cd..3cf3529888c7409a32881ad2f5127da3fb472d6b 100644 (file)
@@ -267,7 +267,7 @@ static irqreturn_t at91_rtc_interrupt(int irq, void *dev_id,
        return IRQ_NONE;                /* not handled */
 }
 
-static struct rtc_class_ops at91_rtc_ops = {
+static const struct rtc_class_ops at91_rtc_ops = {
        .ioctl          = at91_rtc_ioctl,
        .read_time      = at91_rtc_readtime,
        .set_time       = at91_rtc_settime,
index 629d47cc7e88e042c479e9b01c5a5bfcd738f24c..583789c66cdb9d2404157f0cda029c9e8dfc7c60 100644 (file)
@@ -24,7 +24,7 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
        int err;
        struct rtc_device *rtc = container_of(inode->i_cdev,
                                        struct rtc_device, char_dev);
-       struct rtc_class_ops *ops = rtc->ops;
+       const struct rtc_class_ops *ops = rtc->ops;
 
        /* We keep the lock as long as the device is in use
         * and return immediately if busy
@@ -209,7 +209,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file,
        int err = 0;
        struct class_device *class_dev = file->private_data;
        struct rtc_device *rtc = to_rtc_device(class_dev);
-       struct rtc_class_ops *ops = rtc->ops;
+       const struct rtc_class_ops *ops = rtc->ops;
        struct rtc_time tm;
        struct rtc_wkalrm alarm;
        void __user *uarg = (void __user *) arg;
index e8afb9384786a605a0881d153474f4ca0554c2ac..cc5032b6f42ac45c9aba4f0ff896b17585a6c813 100644 (file)
@@ -178,7 +178,7 @@ static int ds1307_set_time(struct device *dev, struct rtc_time *t)
        return 0;
 }
 
-static struct rtc_class_ops ds13xx_rtc_ops = {
+static const struct rtc_class_ops ds13xx_rtc_ops = {
        .read_time      = ds1307_get_time,
        .set_time       = ds1307_set_time,
 };
index 209001495474f9f88b74cbee8bb410fd7b868523..4fc9422ed86ddbccff15f7d160640cc1a0e38913 100644 (file)
@@ -250,7 +250,7 @@ static int ds1553_rtc_ioctl(struct device *dev, unsigned int cmd,
        return 0;
 }
 
-static struct rtc_class_ops ds1553_rtc_ops = {
+static const struct rtc_class_ops ds1553_rtc_ops = {
        .read_time      = ds1553_rtc_read_time,
        .set_time       = ds1553_rtc_set_time,
        .read_alarm     = ds1553_rtc_read_alarm,
index 9be81fd4737c20c11cbcc4c2e466a41331c01434..9c68ec99afa5776ad23d039efd693b02ef2d4890 100644 (file)
@@ -156,7 +156,7 @@ static ssize_t show_control(struct device *dev, struct device_attribute *attr, c
 }
 static DEVICE_ATTR(control, S_IRUGO, show_control, NULL);
 
-static struct rtc_class_ops ds1672_rtc_ops = {
+static const struct rtc_class_ops ds1672_rtc_ops = {
        .read_time      = ds1672_rtc_read_time,
        .set_time       = ds1672_rtc_set_time,
        .set_mmss       = ds1672_rtc_set_mmss,
index 8e47e5a06d2a48c336cd4cd44e6b4e86a16670fe..01da5ab15fbc547b94b313554e2aced95169b882 100644 (file)
@@ -116,7 +116,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
        return 0;
 }
 
-static struct rtc_class_ops ds1742_rtc_ops = {
+static const struct rtc_class_ops ds1742_rtc_ops = {
        .read_time      = ds1742_rtc_read_time,
        .set_time       = ds1742_rtc_set_time,
 };
index e1a1169e46649f4be8c8917f5a1a9b6cc7230615..ef4f147f3c0c30b0a16b46908f545f3ac6001eb1 100644 (file)
@@ -73,7 +73,7 @@ static int ep93xx_rtc_proc(struct device *dev, struct seq_file *seq)
        return 0;
 }
 
-static struct rtc_class_ops ep93xx_rtc_ops = {
+static const struct rtc_class_ops ep93xx_rtc_ops = {
        .read_time      = ep93xx_rtc_read_time,
        .set_time       = ep93xx_rtc_set_time,
        .set_mmss       = ep93xx_rtc_set_mmss,
index f324d0a635d4743c9268e4f914fcd51a8069af17..1c743641b73b294c0e365b4ca27a93ff14015bbd 100644 (file)
@@ -390,7 +390,7 @@ static int isl1208_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
        return isl1208_i2c_read_alarm(to_i2c_client(dev), alarm);
 }
 
-static struct rtc_class_ops isl1208_rtc_ops = {
+static const struct rtc_class_ops isl1208_rtc_ops = {
        .proc           = isl1208_rtc_proc,
        .read_time      = isl1208_rtc_read_time,
        .set_time       = isl1208_rtc_set_time,
index 8c0d1a6739adb23012a1c92bf9a102898b9a94cf..8ff4a1221f59a4a1aaa549451b659cab8f7d4c6a 100644 (file)
@@ -138,7 +138,7 @@ static int m48t86_rtc_proc(struct device *dev, struct seq_file *seq)
        return 0;
 }
 
-static struct rtc_class_ops m48t86_rtc_ops = {
+static const struct rtc_class_ops m48t86_rtc_ops = {
        .read_time      = m48t86_rtc_read_time,
        .set_time       = m48t86_rtc_set_time,
        .proc           = m48t86_rtc_proc,
index 2c9739562b5c284a740d2e004ab776abeaf0039a..9eeef964663ac84597f7d1ab1d754e1df302063c 100644 (file)
@@ -207,7 +207,7 @@ static int max6902_set_time(struct device *dev, struct rtc_time *tm)
        return max6902_set_datetime(dev, tm);
 }
 
-static struct rtc_class_ops max6902_rtc_ops = {
+static const struct rtc_class_ops max6902_rtc_ops = {
        .read_time      = max6902_read_time,
        .set_time       = max6902_set_time,
 };
index bd431064303857c5ab5497bf6bf5374efbe4025a..a760cf69af90de24bb80782fbdbf3a393d08777c 100644 (file)
@@ -227,7 +227,7 @@ static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm)
        return pcf8563_set_datetime(to_i2c_client(dev), tm);
 }
 
-static struct rtc_class_ops pcf8563_rtc_ops = {
+static const struct rtc_class_ops pcf8563_rtc_ops = {
        .read_time      = pcf8563_rtc_read_time,
        .set_time       = pcf8563_rtc_set_time,
 };
index b235a30cb6610b67c12f82447ecdb534d5b91e51..5875ebb8c79d9c3070c025860a8a5b1cf428fbec 100644 (file)
@@ -273,7 +273,7 @@ static int pcf8583_rtc_set_time(struct device *dev, struct rtc_time *tm)
        return ret;
 }
 
-static struct rtc_class_ops pcf8583_rtc_ops = {
+static const struct rtc_class_ops pcf8583_rtc_ops = {
        .read_time      = pcf8583_rtc_read_time,
        .set_time       = pcf8583_rtc_set_time,
 };
index d6d1c5726b0ee87347e9532a1da267c6cb1c79e3..739d1a6e14eb9054d717bda6eef4f8266d3213fd 100644 (file)
@@ -128,7 +128,7 @@ static int pl031_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
        return 0;
 }
 
-static struct rtc_class_ops pl031_ops = {
+static const struct rtc_class_ops pl031_ops = {
        .open = pl031_open,
        .release = pl031_release,
        .ioctl = pl031_ioctl,
index 2943d83edfd161c07e924155a75e8ec6867309b2..d51d8f20e634e020428b834febb6852731303310 100644 (file)
@@ -23,7 +23,7 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
 {
        int err;
        struct class_device *class_dev = seq->private;
-       struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops;
+       const struct rtc_class_ops *ops = to_rtc_device(class_dev)->ops;
        struct rtc_wkalrm alrm;
        struct rtc_time tm;
 
index 25589061f9310d6555d729205b09490982c19132..f50f3fc353cd64be4845c8dcc90bfd6eeb7cc877 100644 (file)
@@ -140,7 +140,7 @@ rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm)
        return 0;
 }
 
-static struct rtc_class_ops rs5c348_rtc_ops = {
+static const struct rtc_class_ops rs5c348_rtc_ops = {
        .read_time      = rs5c348_rtc_read_time,
        .set_time       = rs5c348_rtc_set_time,
 };
index 7553d797603fd86d78a266d578765e439ea5aced..bbdad099471d43b65d33ec05161f1f88e01b0dac 100644 (file)
@@ -160,7 +160,7 @@ static int rs5c372_rtc_proc(struct device *dev, struct seq_file *seq)
        return 0;
 }
 
-static struct rtc_class_ops rs5c372_rtc_ops = {
+static const struct rtc_class_ops rs5c372_rtc_ops = {
        .proc           = rs5c372_rtc_proc,
        .read_time      = rs5c372_rtc_read_time,
        .set_time       = rs5c372_rtc_set_time,
index 2c7de79c83b9baa352769e7626bc06b27c8abb60..625dad2eeb4f4fa2b8f787ce805bf44c67eccf56 100644 (file)
@@ -386,7 +386,7 @@ static void s3c_rtc_release(struct device *dev)
        free_irq(s3c_rtc_tickno, rtc_dev);
 }
 
-static struct rtc_class_ops s3c_rtcops = {
+static const struct rtc_class_ops s3c_rtcops = {
        .open           = s3c_rtc_open,
        .release        = s3c_rtc_release,
        .ioctl          = s3c_rtc_ioctl,
index ee4b61ee67b03de09faa6296137dd0c3f925d495..439c41aea31c9d091bcfe66f326d2ba3afdd2679 100644 (file)
@@ -303,7 +303,7 @@ static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq)
        return 0;
 }
 
-static struct rtc_class_ops sa1100_rtc_ops = {
+static const struct rtc_class_ops sa1100_rtc_ops = {
        .open = sa1100_rtc_open,
        .read_callback = sa1100_rtc_read_callback,
        .release = sa1100_rtc_release,
index e1fa5fe7901f900167b448997cb4f4373a85e892..bc4bd24508a2d4beb23458c3b6ee3a86b7e41e26 100644 (file)
@@ -75,7 +75,7 @@ static int test_rtc_ioctl(struct device *dev, unsigned int cmd,
        }
 }
 
-static struct rtc_class_ops test_rtc_ops = {
+static const struct rtc_class_ops test_rtc_ops = {
        .proc = test_rtc_proc,
        .read_time = test_rtc_read_time,
        .set_time = test_rtc_set_time,
index e28cc4b0901ace9f0405983f757480ec9135cae1..09b714f1cdc39f9dedb4cad38b5b036677a0d9dd 100644 (file)
@@ -149,7 +149,7 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt)
        return 0;
 }
 
-static struct rtc_class_ops v3020_rtc_ops = {
+static const struct rtc_class_ops v3020_rtc_ops = {
        .read_time      = v3020_read_time,
        .set_time       = v3020_set_time,
 };
index 596764fd29f5a320cfeb89a4fb0823cac3972720..58e5ed0aa12702fc9798f03eb915f262d7f92a8c 100644 (file)
@@ -296,7 +296,7 @@ static irqreturn_t rtclong1_interrupt(int irq, void *dev_id, struct pt_regs *reg
        return IRQ_HANDLED;
 }
 
-static struct rtc_class_ops vr41xx_rtc_ops = {
+static const struct rtc_class_ops vr41xx_rtc_ops = {
        .release        = vr41xx_rtc_release,
        .ioctl          = vr41xx_rtc_ioctl,
        .read_time      = vr41xx_rtc_read_time,
index 788b6d1f8f2fd282cac69e6b8a5c0e9a3698c9f2..522c69753bbfb3843b6dccf1c4f922b43e45a666 100644 (file)
@@ -460,7 +460,7 @@ static int x1205_rtc_proc(struct device *dev, struct seq_file *seq)
        return 0;
 }
 
-static struct rtc_class_ops x1205_rtc_ops = {
+static const struct rtc_class_ops x1205_rtc_ops = {
        .proc           = x1205_rtc_proc,
        .read_time      = x1205_rtc_read_time,
        .set_time       = x1205_rtc_set_time,
index 5371e4e745958f37e67cba09db7eaa9e49a2ada0..b89f09357054ff13414eade0f14dc0748e98f925 100644 (file)
@@ -141,7 +141,7 @@ struct rtc_device
        int id;
        char name[RTC_DEVICE_NAME_SIZE];
 
-       struct rtc_class_ops *ops;
+       const struct rtc_class_ops *ops;
        struct mutex ops_lock;
 
        struct class_device *rtc_dev;
@@ -172,7 +172,7 @@ struct rtc_device
 
 extern struct rtc_device *rtc_device_register(const char *name,
                                        struct device *dev,
-                                       struct rtc_class_ops *ops,
+                                       const struct rtc_class_ops *ops,
                                        struct module *owner);
 extern void rtc_device_unregister(struct rtc_device *rdev);
 extern int rtc_interface_register(struct class_interface *intf);