b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -157,7 +157,7 @@ static __init void omapl138_hawk_mmc_init(void)
if (ret < 0) {
pr_warning("%s: can not open GPIO %d\n",
__func__, DA850_HAWK_MMCSD_CD_PIN);
- return;
+ goto exp_setup_cd_fail;
}
ret = gpio_request_one(DA850_HAWK_MMCSD_WP_PIN,
@@ -165,13 +165,23 @@ static __init void omapl138_hawk_mmc_init(void)
if (ret < 0) {
pr_warning("%s: can not open GPIO %d\n",
__func__, DA850_HAWK_MMCSD_WP_PIN);
- return;
+ goto exp_setup_wp_fail;
}
ret = da8xx_register_mmcsd0(&da850_mmc_config);
- if (ret)
+ if (ret) {
pr_warning("%s: MMC/SD0 registration failed: %d\n",
__func__, ret);
+ goto exp_setup_mmcsd_fail;
+ }
+ return;
+
+exp_setup_mmcsd_fail:
+ gpio_free(DA850_HAWK_MMCSD_WP_PIN);
+exp_setup_wp_fail:
+ gpio_free(DA850_HAWK_MMCSD_CD_PIN);
+exp_setup_cd_fail:
+ return;
}
static irqreturn_t omapl138_hawk_usb_ocic_irq(int irq, void *dev_id);
@@ -211,7 +221,7 @@ static int
hawk_usb_ocic_notify(da8xx_ocic_handler_t handler)
IRQF_TRIGGER_FALLING,
"OHCI over-current indicator", NULL);
if (error)
- pr_err(KERN_ERR "%s: could not request IRQ to watch "
+ pr_err("%s: could not request IRQ to watch "
"over-current indicator changes\n", __func__);
} else {