Check for altname == NULL in snd-pmac-gpio.c
PATCH 1/1 Check for altname == NULL in snd-pmac-gpio.c
Since callers don't have to pass altname, snd-pmac-gpio.c should have been checking for NULL, and it wasn't.
Also, fixes the pmf_unregister_irq_client() call to match the previous patch.
Signed-off-by Ben Collins <[email protected]>
sound/ppc/snd-pmac-gpio.c +5 -9
@@ -41,7 +41,7 @@ static struct pmf_function *get_audio_pfreturn NULL ; pfunc =pmf_find_function (np, name); -if (pfunc ==NULL && altname !=NULL ) +if (pfunc ==NULL && altname) pfunc =pmf_find_function (np, altname);return pfunc;
@@ -58,10 +58,10 @@ static struct device_node *find_audio_gpfor (np = np->child; np; np = np->sibling) {char *property =get_property (np,"audio-gpio" ,NULL );if (property && (strcmp (property, name) ==0 || -strcmp (property, altname) ==0 )) + (altname &&strcmp (property, altname) ==0 )))break ;if (device_is_compatible (np, name) || -device_is_compatible (np, altname)) + (altname &&device_is_compatible (np, altname)))break ; }
@@ -136,11 +136,7 @@ void snd_pmac_free_gpio(snd_pmac_gpio_t {if (gp->pfunc !=NULL ) {if (gp->irq_client.owner ==THIS_MODULE ) { -/* XXX: pmf_unregister_irq_client doesn't use its -* first two arguments. We only need to send it -* the irq_client. WATCH FOR THIS CHANGING! -*/ -pmf_unregister_irq_client (NULL ,NULL , &gp->irq_client); +pmf_unregister_irq_client (&gp->irq_client); gp->irq_client.owner =NULL ; }
@@ -233,7 +229,7 @@ int snd_pmac_request_irq(snd_pmac_gpio_tif ((np =find_devices ("i2s-a" ))) { ret =pmf_register_irq_client (np, gp->name, &gp->irq_client); -if (ret <0 ) +if (ret <0 && gp->altname) ret =pmf_register_irq_client (np, gp->altname, &gp->irq_client); }if (ret <0 )
Signature · 2 lines
Ben Collins Kernel Developer - Ubuntu Linux