From patchwork Mon Feb 3 14:35:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 235840 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Mon, 3 Feb 2020 07:35:53 -0700 Subject: [PATCH v2 07/32] gpio: Rename free() to rfree() In-Reply-To: <20200203143618.74619-1-sjg@chromium.org> References: <20200203143618.74619-1-sjg@chromium.org> Message-ID: <20200203073614.v2.7.Ib38dca8a84963a43157a31475f2cc51e59d0a398@changeid> This function name conflicts with our desire to #define free() to something else on sandbox. Since it deals with resources, rename it to rfree(). Signed-off-by: Simon Glass --- Changes in v2: None drivers/gpio/gpio-rcar.c | 2 +- drivers/gpio/gpio-uclass.c | 4 ++-- include/asm-generic/gpio.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index 594e0a470a..a8c5b7f879 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -128,7 +128,7 @@ static int rcar_gpio_free(struct udevice *dev, unsigned offset) static const struct dm_gpio_ops rcar_gpio_ops = { .request = rcar_gpio_request, - .free = rcar_gpio_free, + .rfree = rcar_gpio_free, .direction_input = rcar_gpio_direction_input, .direction_output = rcar_gpio_direction_output, .get_value = rcar_gpio_get_value, diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index 90fbed455b..4c155fceb5 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -364,8 +364,8 @@ int _dm_gpio_free(struct udevice *dev, uint offset) uc_priv = dev_get_uclass_priv(dev); if (!uc_priv->name[offset]) return -ENXIO; - if (gpio_get_ops(dev)->free) { - ret = gpio_get_ops(dev)->free(dev, offset); + if (gpio_get_ops(dev)->rfree) { + ret = gpio_get_ops(dev)->rfree(dev, offset); if (ret) return ret; } diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index d6cf18744f..05777e6afe 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -248,7 +248,7 @@ int gpio_xlate_offs_flags(struct udevice *dev, struct gpio_desc *desc, */ struct dm_gpio_ops { int (*request)(struct udevice *dev, unsigned offset, const char *label); - int (*free)(struct udevice *dev, unsigned offset); + int (*rfree)(struct udevice *dev, unsigned int offset); int (*direction_input)(struct udevice *dev, unsigned offset); int (*direction_output)(struct udevice *dev, unsigned offset, int value);