From f23a09eea1e7947611d985d8cd13d55428ff0af8 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 28 May 2019 09:05:31 +0200 Subject: ALSA: line6: Use container_of() ... instead of unconditional cast. Signed-off-by: Takashi Iwai --- sound/usb/line6/podhd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sound/usb/line6/podhd.c') 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; -- cgit v1.2.3