mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
adc_factory: return -EINVAL if fail to register adc channel
This commit is contained in:
@@ -1547,12 +1547,12 @@ static int rk30_adc_battery_probe(struct platform_device *pdev)
|
||||
memset(data->adc_samples, 0, sizeof(int)*(NUM_VOLTAGE_SAMPLE + 2));
|
||||
|
||||
//register adc for battery sample
|
||||
if(0 == pdata->adc_channel)
|
||||
client = adc_register(0, rk30_adc_battery_callback, NULL); //pdata->adc_channel = ani0
|
||||
else
|
||||
client = adc_register(pdata->adc_channel, rk30_adc_battery_callback, NULL);
|
||||
if(!client)
|
||||
client = adc_register(pdata->adc_channel, rk30_adc_battery_callback, NULL);
|
||||
if(!client){
|
||||
printk(KERN_INFO "fail to register adc channel(%d)\n", pdata->adc_channel);
|
||||
ret = -EINVAL;
|
||||
goto err_adc_register_failed;
|
||||
}
|
||||
|
||||
//variable init
|
||||
data->client = client;
|
||||
|
||||
Reference in New Issue
Block a user