diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-05-19 06:57:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-06-11 15:02:54 -0400 |
commit | 5daf53a6eb5c54c618c9def388d81c2769fd11a0 (patch) | |
tree | ae26108d5971c8e9fb7fcc5d9795b12145a1466b /include | |
parent | 0875eb755b66a6766be117133dbb6d8157ace337 (diff) |
[media] snd_tea575x: Make the module using snd_tea575x the fops owner
Before this patch the owner field of the /dev/radio# device fops was set to
the snd-tea575x-tuner module itself. Meaning that the module which was using
it could be rmmod-ed while the device is open, and then BAD things happen.
I know, as I found out the hard way :)
Note that there is no need to also somehow increase the refcount of the
snd-tea575x-tuner module itself, since any drivers using it will have
symbolic references to it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
CC: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/tea575x-tuner.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h index ec3f910aa40b..0c3c2fb0f939 100644 --- a/include/sound/tea575x-tuner.h +++ b/include/sound/tea575x-tuner.h | |||
@@ -44,6 +44,7 @@ struct snd_tea575x_ops { | |||
44 | 44 | ||
45 | struct snd_tea575x { | 45 | struct snd_tea575x { |
46 | struct v4l2_device *v4l2_dev; | 46 | struct v4l2_device *v4l2_dev; |
47 | struct v4l2_file_operations fops; | ||
47 | struct video_device vd; /* video device */ | 48 | struct video_device vd; /* video device */ |
48 | int radio_nr; /* radio_nr */ | 49 | int radio_nr; /* radio_nr */ |
49 | bool tea5759; /* 5759 chip is present */ | 50 | bool tea5759; /* 5759 chip is present */ |
@@ -62,7 +63,7 @@ struct snd_tea575x { | |||
62 | int (*ext_init)(struct snd_tea575x *tea); | 63 | int (*ext_init)(struct snd_tea575x *tea); |
63 | }; | 64 | }; |
64 | 65 | ||
65 | int snd_tea575x_init(struct snd_tea575x *tea); | 66 | int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); |
66 | void snd_tea575x_exit(struct snd_tea575x *tea); | 67 | void snd_tea575x_exit(struct snd_tea575x *tea); |
67 | 68 | ||
68 | #endif /* __SOUND_TEA575X_TUNER_H */ | 69 | #endif /* __SOUND_TEA575X_TUNER_H */ |