Thread (50 messages) 50 messages, 6 authors, 2012-11-09

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

From: Hongbo Zhang <hidden>
Date: 2012-10-25 10:43:58
Also in: lkml

On 25 October 2012 17:42, Viresh Kumar [off-list ref] wrote:
On 25 October 2012 15:03, Hongbo Zhang [off-list ref] wrote:
quoted
On 25 October 2012 16:41, Viresh Kumar [off-list ref] wrote:
quoted
Just paste my current pieces of codes here:

static struct db8500_thsens_platform_data*
                db8500_thermal_parse_dt(struct platform_device *pdev)
{
quoted
        if (!np) {
                dev_err(&pdev->dev, "Missing device tree data\n");
quoted
}

static int db8500_thermal_probe(struct platform_device *pdev)
{
quoted
        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.
quoted
quoted
quoted
quoted
quoted
+       ret = devm_request_threaded_irq(&pdev->dev, low_irq, NULL,
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help