Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1331026 > unrolled thread
| Started by | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| First post | 2016-02-10 11:20 +0100 |
| Last post | 2016-02-10 11:20 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 3/5] gpio: ath79: Make the driver removable Linus Walleij <linus.walleij@linaro.org> - 2016-02-10 11:20 +0100
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-02-10 11:20 +0100 |
| Subject | Re: [PATCH 3/5] gpio: ath79: Make the driver removable |
| Message-ID | <r0A2n-Sb-35@gated-at.bofh.it> |
On Mon, Feb 8, 2016 at 4:04 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Fri, Jan 29, 2016 at 4:44 AM, Alban Bedel <albeu@free.fr> wrote:
>> As we now allow the driver to be built as a module it should be
>> removable.
>>
>> Signed-off-by: Alban Bedel <albeu@free.fr>
>> ---
>> drivers/gpio/gpio-ath79.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
>> index afb535e..6b15792 100644
>> --- a/drivers/gpio/gpio-ath79.c
>> +++ b/drivers/gpio/gpio-ath79.c
>> @@ -46,6 +46,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
>> ctrl = devm_kzalloc(&pdev->dev, sizeof(*ctrl), GFP_KERNEL);
>> if (!ctrl)
>> return -ENOMEM;
>> + platform_set_drvdata(pdev, ctrl);
>>
>> if (np) {
>> err = of_property_read_u32(np, "ngpios", &ath79_gpio_count);
>> @@ -97,12 +98,21 @@ static int ath79_gpio_probe(struct platform_device *pdev)
>> return 0;
>> }
>>
>> +static int ath79_gpio_remove(struct platform_device *pdev)
>> +{
>> + struct ath79_gpio_ctrl *ctrl = platform_get_drvdata(pdev);
>
> platform_get_drvdata will return a gpio_chip *.
No it will return a struct ath79_gpio_ctrl * AFAICT.
bgpio will set the driver data to the gc but not when using generic gpio
as library like this driver does, only when it is used as a stand-alone device.
Yours,
Linus Walleij
Back to top | Article view | linux.kernel
csiph-web