aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/line6/podhd.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-05-28 09:05:31 +0200
committerTakashi Iwai <tiwai@suse.de>2019-05-28 09:05:31 +0200
commitf23a09eea1e7947611d985d8cd13d55428ff0af8 (patch)
tree430c10328cbfeb92c08c9712d6bdf1a98513771f /sound/usb/line6/podhd.c
parentALSA: line6: Drop superfluous timer helper function (diff)
downloadlinux-dev-f23a09eea1e7947611d985d8cd13d55428ff0af8.tar.xz
linux-dev-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.c8
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;