All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 08/09] input: enable touch on 88pm860x
Date: Wed, 9 Dec 2009 19:57:26 -0800	[thread overview]
Message-ID: <200912091957.26793.dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20091210032149.GH10138@core.coreip.homeip.net>

On Wednesday 09 December 2009 07:21:49 pm Dmitry Torokhov wrote:
> > +
> > +static int __devinit pm860x_touch_probe(struct platform_device *pdev)
> > +{
> > +	struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
> > +	struct pm860x_platform_data *pm860x_pdata;
> > +	struct pm860x_touch_pdata *pdata;
> > +	struct pm860x_touch *touch;
> > +	int irq, ret;
> > +
> > +	irq = platform_get_irq(pdev, 0);
> > +	if (irq < 0) {
> > +		dev_err(&pdev->dev, "No IRQ resource!\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (pdev->dev.parent->platform_data) {
> > +		pm860x_pdata = pdev->dev.parent->platform_data;
> > +		pdata = pm860x_pdata->touch;
> > +	} else
> > +		pdata = NULL;
> > +
> > +	if (pdata == NULL) {
> > +		dev_err(&pdev->dev, "platform data isn't assigned to "
> > +			"touch\n");
> > +		return -EINVAL;
> > +	}
> 
> This should be written as:
> 
> ...
> 	struct pm860x_platform_data *pm860x_pdata =
>  pdev->dev.parent->platform_data; ...
> 
> 	if (pm860x_pdata) {
> 		pdata = pm860x_pdata->touch;
> 		if (!pdata) {
> 			dev_err(&pdev->dev,
> 				"touchscreen platform data is missing\n");
> 			return -EINVAL;
> 		}
> 	}

Ugh, sorry, it was pure garbage... long day for me...

	if (!pm860x_pdata) {
		dev_err(&pdev->dev, "platform data is missing\n");
		return -EINVAL;
	}

	pdata = pm860x_pdata->touch;
	if (!pdata) {
		dev_err(&pdev->dev, "touchscreen data is missing\n");
		return -EINVAL;
	}
 
should be better.

Sorry for the confusion.

-- 
Dmitry

  parent reply	other threads:[~2009-12-10  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-09 13:17 [PATCH v2 08/09] input: enable touch on 88pm860x Haojian Zhuang
2009-12-10  3:21 ` Dmitry Torokhov
2009-12-10  3:41   ` Haojian Zhuang
2009-12-10  3:57   ` Dmitry Torokhov [this message]
2009-12-10  4:06     ` Haojian Zhuang
2010-01-07 19:51       ` Samuel Ortiz
2010-01-07 19:56         ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200912091957.26793.dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.