From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Tony Prisk <linux@prisktech.co.nz>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>,
vt8500-wm8505-linux-kernel@googlegroups.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] gpio: vt8500: memory cleanup missing
Date: Thu, 10 Jan 2013 10:57:10 +0000 [thread overview]
Message-ID: <20130110105710.GA19944@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1357163240-23131-1-git-send-email-linux@prisktech.co.nz>
On Thu, Jan 03, 2013 at 10:47:20AM +1300, Tony Prisk wrote:
> There is also no .remove callback defined. To allow removing the
> registered chips, I have moved *vtchip to be a static global.
What? Why?
> +/* Pointer to our array of chips */
> +static struct vt8500_gpio_chip *vtchip;
> +
...
> +static int vt8500_gpio_remove(struct platform_device *pdev)
> +{
> + int i;
> + int ret;
> + const struct vt8500_gpio_data *data;
> + void __iomem *gpio_base = vtchip[0].base;
> + const struct of_device_id *of_id =
> + of_match_device(vt8500_gpio_dt_ids, &pdev->dev);
> +
You can get at the vtchip pointer if you put it into the platform device's
driver data pointer. That way, you're not artificially limiting this
driver to just one device, and, with your changes it will go wrong if DT
ever lists more than one device.
next prev parent reply other threads:[~2013-01-10 10:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-02 21:47 [PATCH] gpio: vt8500: memory cleanup missing Tony Prisk
2013-01-10 10:51 ` Linus Walleij
2013-01-10 10:57 ` Russell King - ARM Linux [this message]
2013-01-10 12:02 ` Linus Walleij
2013-01-10 18:45 ` Tony Prisk
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=20130110105710.GA19944@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=vt8500-wm8505-linux-kernel@googlegroups.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