devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Marek Belisko <marek@goldelico.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	bcousson@baylibre.com, tony@atomide.com, linux@arm.linux.org.uk,
	plagnioj@jcrosoft.com, grant.likely@linaro.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-fbdev@vger.kernel.org, hns@goldelico.com
Subject: Re: [PATCH v3 1/3] video: omapdss: Add opa362 driver
Date: Wed, 3 Dec 2014 14:13:54 +0200	[thread overview]
Message-ID: <547EFE82.7020701@ti.com> (raw)
In-Reply-To: <1417352867-7436-2-git-send-email-marek@goldelico.com>

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

Hi,

On 30/11/14 15:07, Marek Belisko wrote:

> +#include <video/omap-panel-data.h>

This should not be needed, as the driver is DT only.

> +static int opa362_probe(struct platform_device *pdev)
> +{
> +	struct device_node *node = pdev->dev.of_node;
> +	struct panel_drv_data *ddata;
> +	struct omap_dss_device *dssdev, *in;
> +	struct gpio_desc *gpio;
> +	int r;
> +
> +	dev_dbg(&pdev->dev, "probe\n");
> +
> +	if (node == NULL) {
> +		dev_err(&pdev->dev, "Unable to find device tree\n");
> +		return -EINVAL;
> +	}
> +
> +	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
> +	if (!ddata)
> +		return -ENOMEM;
> +
> +	platform_set_drvdata(pdev, ddata);
> +
> +	gpio = devm_gpiod_get(&pdev->dev, "enable");
> +	if (IS_ERR(gpio)) {
> +		if (PTR_ERR(gpio) != -ENOENT)
> +			return PTR_ERR(gpio);
> +	} else {
> +		gpiod_direction_output(gpio, 0);
> +	}
> +
> +	ddata->enable_gpio = gpio;

The 'gpio' may be non-null here, if PTR_ERR(gpio) == -ENOENT. You should
set 'gpio' to NULL in the IS_ERR(gpio) path, as you later check the gpio
for NULL.

> +static struct platform_driver opa362_driver = {
> +	.probe	= opa362_probe,
> +	.remove	= __exit_p(opa362_remove),
> +	.driver	= {
> +		.name	= "amplifier-opa362",
> +		.owner	= THIS_MODULE,
> +		.of_match_table = opa362_of_match,
> +	},

Here you should add:

.suppress_bind_attrs = true,

so that the device/driver cannot be unbound via sysfs, as that's not
supported at the moment.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-12-03 12:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30 13:07 [PATCH v3 0/3] omapdss: Add video output support for gta04 Marek Belisko
2014-11-30 13:07 ` [PATCH v3 1/3] video: omapdss: Add opa362 driver Marek Belisko
2014-12-03 12:13   ` Tomi Valkeinen [this message]
2014-11-30 13:07 ` [PATCH v3 2/3] Documentation: DT: Add documentation for ti,opa362 bindings Marek Belisko
2014-12-03 12:18   ` Tomi Valkeinen
2014-11-30 13:07 ` [PATCH v3 3/3] arm: dts: omap3-gta04: Add handling for tv output Marek Belisko

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=547EFE82.7020701@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=hns@goldelico.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=marek@goldelico.com \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=robh+dt@kernel.org \
    --cc=tony@atomide.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).