Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff8371ac authored by David Brownell's avatar David Brownell Committed by Linus Torvalds
Browse files

[PATCH] constify rtc_class_ops: update drivers



Update RTC framework so that drivers can constify their method tables, moving
them from ".data" to ".rodata".  Then update the drivers.

Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent db621f17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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,
+2 −2
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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,
};
+1 −1
Original line number Diff line number Diff line
@@ -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,
Loading