otgcontrol: clean up uninitialize code in driver probe
parent
7f19e08723
commit
a7a96a0a46
|
@ -198,22 +198,18 @@ static int rm_otgcontrol_probe(struct platform_device *pdev)
|
|||
platform_set_drvdata(pdev, otgc_data);
|
||||
return 0;
|
||||
|
||||
error_1:
|
||||
kfree(otgc_data);
|
||||
return ret;
|
||||
|
||||
error_2:
|
||||
kfree(pdata);
|
||||
kfree(otgc_data);
|
||||
return ret;
|
||||
|
||||
error_3:
|
||||
otgcontrol_uninit_sysfs_nodes(otgc_data);
|
||||
otgcontrol_uninit_extcon(otgc_data);
|
||||
otgcontrol_uninit_one_wire_mux_state(otgc_data);
|
||||
otgcontrol_uninit_gpio_irq(otgc_data);
|
||||
|
||||
error_2:
|
||||
kfree(pdata);
|
||||
|
||||
error_1:
|
||||
kfree(otgc_data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,10 @@ int otgcontrol_init_one_wire_mux_state(struct rm_otgcontrol_data *otgc_data)
|
|||
|
||||
void otgcontrol_uninit_one_wire_mux_state(struct rm_otgcontrol_data *otgc_data)
|
||||
{
|
||||
devm_pinctrl_put(otgc_data->one_wire_pinctrl);
|
||||
if ((otgc_data->one_wire_pinctrl != NULL) && !IS_ERR(otgc_data->one_wire_pinctrl)) {
|
||||
devm_pinctrl_put(otgc_data->one_wire_pinctrl);
|
||||
otgc_data->one_wire_pinctrl = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int otgcontrol_switch_one_wire_mux_state(struct rm_otgcontrol_data *otgc_data, int state)
|
||||
|
|
|
@ -183,7 +183,6 @@ int otgcontrol_init_sysfs_nodes(struct rm_otgcontrol_data *otgc_data)
|
|||
|
||||
void otgcontrol_uninit_sysfs_nodes(struct rm_otgcontrol_data *otgc_data)
|
||||
{
|
||||
printk("%s: Enter\n", __func__);
|
||||
printk("%s: Decrementing kobject refcount\n", __func__);
|
||||
if((otgc_data->kobject != NULL) && !IS_ERR(otgc_data->kobject)) {
|
||||
kobject_put(otgc_data->kobject);
|
||||
|
|
Loading…
Reference in New Issue