On 25 October 2012 17:42, Viresh Kumar <viresh.ku...@linaro.org> wrote: > On 25 October 2012 15:03, Hongbo Zhang <hongbo.zh...@linaro.org> wrote: >> On 25 October 2012 16:41, Viresh Kumar <viresh.ku...@linaro.org> wrote: > >> Just paste my current pieces of codes here: >> >> static struct db8500_thsens_platform_data* >> db8500_thermal_parse_dt(struct platform_device *pdev) >> { > >> if (!np) { >> dev_err(&pdev->dev, "Missing device tree data\n"); > >> } >> >> static int db8500_thermal_probe(struct platform_device *pdev) >> { > >> ptrips = db8500_thermal_parse_dt(pdev); >> if (!ptrips) >> ptrips = dev_get_platdata(&pdev->dev); > > So, the above code still has the flaw i pointed out. It will print > "Missing device tree data", while booting for non-DT case. > > What i would suggest you is: > > static int db8500_thermal_probe(struct platform_device *pdev) > { > struct device_node *np = pdev->dev.of_node; > > if (np) > ptrips = db8500_thermal_parse_dt(pdev); > else > ptrips = dev_get_platdata(&pdev->dev); > > if (!ptrips) > explode!! > This seems neat. > >>>>>> + ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL, > >> I just saw that all the PRCMU and ab8500 related irqs use >> request_threaded_irq >> only difference is that I use devm_request_threaded_irq > > See, i started this threaded_irq thread is to make sure you know > exactly what you > are doing. Others are doing it doesn't mean you should do it too.. :) > > You must dig in a bit to see why is it required for your case? If > earlier code related > to PRCMU and db8500 is correct, then i am sure you need to sleep from your > handler. > > -- > viresh
_______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev