mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [media] radio-si470x: make si470x_viddev_template const
@ 2017-09-27  8:38 Bhumika Goyal
  0 siblings, 0 replies; only message in thread
From: Bhumika Goyal @ 2017-09-27  8:38 UTC (permalink / raw)
  To: julia.lawall, hverkuil, mchehab, linux-media, linux-kernel; +Cc: Bhumika Goyal

Make this const as it is only used in a copy operation in the files
referencing it. Add const to declaration in the header too.

Structure found using Coccienlle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
 drivers/media/radio/si470x/radio-si470x.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index cd76fac..c89a7d5 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -749,7 +749,7 @@ static int si470x_vidioc_enum_freq_bands(struct file *file, void *priv,
 /*
  * si470x_viddev_template - video device interface
  */
-struct video_device si470x_viddev_template = {
+const struct video_device si470x_viddev_template = {
 	.fops			= &si470x_fops,
 	.name			= DRIVER_NAME,
 	.release		= video_device_release_empty,
diff --git a/drivers/media/radio/si470x/radio-si470x.h b/drivers/media/radio/si470x/radio-si470x.h
index 7d2defd..eb7b834 100644
--- a/drivers/media/radio/si470x/radio-si470x.h
+++ b/drivers/media/radio/si470x/radio-si470x.h
@@ -209,7 +209,7 @@ struct si470x_device {
 /**************************************************************************
  * Common Functions
  **************************************************************************/
-extern struct video_device si470x_viddev_template;
+extern const struct video_device si470x_viddev_template;
 extern const struct v4l2_ctrl_ops si470x_ctrl_ops;
 int si470x_get_register(struct si470x_device *radio, int regnr);
 int si470x_set_register(struct si470x_device *radio, int regnr);
-- 
1.9.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-09-27  8:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27  8:38 [PATCH] [media] radio-si470x: make si470x_viddev_template const Bhumika Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®