Re: [PATCH] Make gpiochip label const

From: David Brownell
Date: Wed Aug 20 2008 - 11:55:32 EST


On Wednesday 20 August 2008, Dmitry Baryshkov wrote:
> > I don't recall seeing such warnings and I cannot make them happen with
> > drivers/gpio/gpiolib.c or with drivers/gpio/max732x.c or with
> > drivers/gpio/pca953x.c.  So we still don't know what this patch
> > does :(
>
> Because both mentioned drivers set gpiochip->label to non-const string.
> You can check arch/arm/common/scoop.c for example of driver showing
> different behaviour:

You're doing it wrong -- in a small way, not a big one. Instead of

devptr->gpio.label = dev_name(&pdev->dev);

do

devptr->gpio.label = "scoop";
devptr->gpio.dev = &pdev->dev;

No warnings generated that way, and another field is set up...

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/