@@ -187,6 +187,9 @@ static int atmel_tsadcc_probe(struct platform_device *pdev)
unsigned int prsc;
unsigned int reg;
+ if (!pdata)
+ return -EINVAL;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "no mmio resource defined.\n");
@@ -265,9 +268,6 @@ static int atmel_tsadcc_probe(struct platform_device *pdev)
prsc = clk_get_rate(ts_dev->clk);
dev_info(&pdev->dev, "Master clock is set at: %d Hz\n", prsc);
- if (!pdata)
- goto err_fail;
-
if (!pdata->adc_clock)
pdata->adc_clock = ADC_DEFAULT_CLOCK;