Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a221dd45 authored by Chris Rorvick's avatar Chris Rorvick Committed by Takashi Iwai
Browse files

staging: line6: Pass *_init() `usb_line6' pointers



Casting the `struct usb_line6' pointer at the call point makes the code
difficult to read.  This is substantially cleaned up by moving the cast
into the callees.

Signed-off-by: default avatarChris Rorvick <chris@rorvick.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 16d603d3
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -959,33 +959,26 @@ static int line6_probe(struct usb_interface *interface,
	case LINE6_POCKETPOD:
	case LINE6_PODXT:
	case LINE6_PODXTPRO:
		ret = line6_pod_init(interface, (struct usb_line6_pod *)line6);
		ret = line6_pod_init(interface, line6);
		break;

	case LINE6_PODHD300:
	case LINE6_PODHD400:
	case LINE6_PODHD500_0:
	case LINE6_PODHD500_1:
		ret = line6_podhd_init(interface,
				       (struct usb_line6_podhd *)line6);
		ret = line6_podhd_init(interface, line6);
		break;

	case LINE6_PODXTLIVE_POD:
		ret =
		    line6_pod_init(interface,
				   (struct usb_line6_pod *)line6);
		ret = line6_pod_init(interface, line6);
		break;

	case LINE6_PODXTLIVE_VARIAX:
		ret =
		    line6_variax_init(interface,
				      (struct usb_line6_variax *)line6);
		ret = line6_variax_init(interface, line6);
		break;

	case LINE6_VARIAX:
		ret =
		    line6_variax_init(interface,
				      (struct usb_line6_variax *)line6);
		ret = line6_variax_init(interface, line6);
		break;

	case LINE6_PODSTUDIO_GX:
@@ -995,9 +988,7 @@ static int line6_probe(struct usb_interface *interface,
	case LINE6_TONEPORT_UX1:
	case LINE6_TONEPORT_UX2:
	case LINE6_GUITARPORT:
		ret =
		    line6_toneport_init(interface,
					(struct usb_line6_toneport *)line6);
		ret = line6_toneport_init(interface, line6);
		break;

	default:
+4 −4
Original line number Diff line number Diff line
@@ -353,10 +353,10 @@ static int pod_create_files2(struct device *dev)
	 Try to init POD device.
*/
static int pod_try_init(struct usb_interface *interface,
			struct usb_line6_pod *pod)
			struct usb_line6 *line6)
{
	int err;
	struct usb_line6 *line6 = &pod->line6;
	struct usb_line6_pod *pod = (struct usb_line6_pod *) line6;

	init_timer(&pod->startup_timer);
	INIT_WORK(&pod->startup_work, pod_startup4);
@@ -409,9 +409,9 @@ static int pod_try_init(struct usb_interface *interface,
/*
	 Init POD device (and clean up in case of failure).
*/
int line6_pod_init(struct usb_interface *interface, struct usb_line6_pod *pod)
int line6_pod_init(struct usb_interface *interface, struct usb_line6 *line6)
{
	int err = pod_try_init(interface, pod);
	int err = pod_try_init(interface, line6);

	if (err < 0)
		pod_destruct(interface);
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ struct usb_line6_pod {

extern void line6_pod_disconnect(struct usb_interface *interface);
extern int line6_pod_init(struct usb_interface *interface,
			  struct usb_line6_pod *pod);
			  struct usb_line6 *line6);
extern void line6_pod_process_message(struct usb_line6_pod *pod);

#endif
+2 −2
Original line number Diff line number Diff line
@@ -121,9 +121,9 @@ static int podhd_try_init(struct usb_interface *interface,
/*
	Init POD HD device (and clean up in case of failure).
*/
int line6_podhd_init(struct usb_interface *interface,
		     struct usb_line6_podhd *podhd)
int line6_podhd_init(struct usb_interface *interface, struct usb_line6 *line6)
{
	struct usb_line6_podhd *podhd = (struct usb_line6_podhd *) line6;
	int err = podhd_try_init(interface, podhd);

	if (err < 0)
+1 −1
Original line number Diff line number Diff line
@@ -25,6 +25,6 @@ struct usb_line6_podhd {

extern void line6_podhd_disconnect(struct usb_interface *interface);
extern int line6_podhd_init(struct usb_interface *interface,
			    struct usb_line6_podhd *podhd);
			    struct usb_line6 *line6);

#endif /* PODHD_H */
Loading