Re: [PATCH V2 5/6] Thermal: Add ST-Ericsson DB8500 thermal dirver.

From: Viresh Kumar
Date: Thu Oct 25 2012 - 05:42:05 EST


On 25 October 2012 15:03, Hongbo Zhang <hongbo.zhang@xxxxxxxxxx> wrote:
> On 25 October 2012 16:41, Viresh Kumar <viresh.kumar@xxxxxxxxxx> 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!!


>>>>> + 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/