From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Marc Zyngier <marc.zyngier@arm.com>,
Magnus Damm <magnus.damm@gmail.com>,
Christoffer Dall <christoffer.dall@arm.com>,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-gpio@vger.kernel.org, Alexander Graf <graf@amazon.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Harish Jenny K N <harish_kandiga@mentor.com>,
Phil Reid <preid@electromag.com.au>
Subject: [Qemu-devel] [PATCH/RFC v2 3/5] gpio: Export gpio_name_to_desc() to modular GPIO code
Date: Wed, 11 Sep 2019 16:38:56 +0200 [thread overview]
Message-ID: <20190911143858.13024-4-geert+renesas@glider.be> (raw)
In-Reply-To: <20190911143858.13024-1-geert+renesas@glider.be>
Make gpio_name_to_desc() global, and export its symbol, so modular GPIO
driver can make use of this function.
This will be used by the GPIO Aggregator.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpio/gpiolib.c | 3 ++-
drivers/gpio/gpiolib.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index c2cf01fb72a9de87..c0caafd111e6ff51 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -288,7 +288,7 @@ static int gpiodev_add_to_list(struct gpio_device *gdev)
/*
* Convert a GPIO name to its descriptor
*/
-static struct gpio_desc *gpio_name_to_desc(const char * const name)
+struct gpio_desc *gpio_name_to_desc(const char * const name)
{
struct gpio_device *gdev;
unsigned long flags;
@@ -315,6 +315,7 @@ static struct gpio_desc *gpio_name_to_desc(const char * const name)
return NULL;
}
+EXPORT_SYMBOL_GPL(gpio_name_to_desc);
/*
* Takes the names from gc->names and checks if they are all unique. If they
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index b8b10a409c7b9c65..240d2868a3024b52 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -117,6 +117,7 @@ struct gpio_desc {
const char *name;
};
+struct gpio_desc *gpio_name_to_desc(const char * const name);
int gpiod_request(struct gpio_desc *desc, const char *label);
void gpiod_free(struct gpio_desc *desc);
int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id,
--
2.17.1
next prev parent reply other threads:[~2019-09-11 14:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-11 14:38 [Qemu-devel] [PATCH/RFC v2 0/5] gpio: Add GPIO Aggregator Driver Geert Uytterhoeven
2019-09-11 14:38 ` [Qemu-devel] [PATCH/RFC v2 1/5] gpio: Export gpiod_{request, free}() to modular GPIO code Geert Uytterhoeven
2019-09-11 14:38 ` [Qemu-devel] [PATCH/RFC v2 2/5] gpio: Export gpiochip_get_desc() " Geert Uytterhoeven
2019-09-11 14:38 ` Geert Uytterhoeven [this message]
2019-09-11 14:38 ` [Qemu-devel] [PATCH/RFC v2 4/5] gpio: Add GPIO Forwarder Helper Geert Uytterhoeven
2019-09-11 14:38 ` [Qemu-devel] [PATCH/RFC v2 5/5] gpio: Add GPIO Aggregator Driver Geert Uytterhoeven
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=20190911143858.13024-4-geert+renesas@glider.be \
--to=geert+renesas@glider.be \
--cc=bgolaszewski@baylibre.com \
--cc=christoffer.dall@arm.com \
--cc=graf@amazon.com \
--cc=harish_kandiga@mentor.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=marc.zyngier@arm.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=preid@electromag.com.au \
--cc=qemu-devel@nongnu.org \
/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).