ALSA: line6: Use container_of()

... instead of unconditional cast.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
这个提交包含在:
Takashi Iwai
2019-05-28 09:05:31 +02:00
父节点 be8fd484e9
当前提交 f23a09eea1
修改 4 个文件,包含 25 行新增19 行删除

查看文件

@@ -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;