diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-05-28 09:05:31 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-05-28 09:05:31 +0200 |
commit | f23a09eea1e7947611d985d8cd13d55428ff0af8 (patch) | |
tree | 430c10328cbfeb92c08c9712d6bdf1a98513771f /sound/usb/line6/podhd.c | |
parent | be8fd484e9c23e49ffe1d163c8d32c8c7b745941 (diff) | |
download | linux-stable-f23a09eea1e7947611d985d8cd13d55428ff0af8.tar.gz linux-stable-f23a09eea1e7947611d985d8cd13d55428ff0af8.tar.bz2 linux-stable-f23a09eea1e7947611d985d8cd13d55428ff0af8.zip |
ALSA: line6: Use container_of()
... instead of unconditional cast.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/line6/podhd.c')
-rw-r--r-- | sound/usb/line6/podhd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index 722fc5db09c5..395ae1692f45 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c @@ -44,6 +44,8 @@ struct usb_line6_podhd { int firmware_version; }; +#define line6_to_podhd(x) container_of(x, struct usb_line6_podhd, line6) + static struct snd_ratden podhd_ratden = { .num_min = 48000, .num_max = 48000, @@ -231,7 +233,7 @@ exit: static void podhd_startup(struct usb_line6 *line6) { - struct usb_line6_podhd *pod = (struct usb_line6_podhd *)line6; + struct usb_line6_podhd *pod = line6_to_podhd(line6); podhd_dev_start(pod); line6_read_serial_number(&pod->line6, &pod->serial_number); @@ -241,7 +243,7 @@ static void podhd_startup(struct usb_line6 *line6) static void podhd_disconnect(struct usb_line6 *line6) { - struct usb_line6_podhd *pod = (struct usb_line6_podhd *)line6; + struct usb_line6_podhd *pod = line6_to_podhd(line6); if (pod->line6.properties->capabilities & LINE6_CAP_CONTROL_INFO) { struct usb_interface *intf; @@ -260,7 +262,7 @@ static int podhd_init(struct usb_line6 *line6, const struct usb_device_id *id) { int err; - struct usb_line6_podhd *pod = (struct usb_line6_podhd *) line6; + struct usb_line6_podhd *pod = line6_to_podhd(line6); struct usb_interface *intf; line6->disconnect = podhd_disconnect; |