From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Kyle Tso <kyletso@google.com>
Subject: Re: [PATCH v1 3/4] usb: typec: tcpci_maxim: Export helper function for register reads
Date: Tue, 30 Aug 2022 13:57:49 +0300 [thread overview]
Message-ID: <Yw3tLf6lcmtU1+t/@kuha.fi.intel.com> (raw)
In-Reply-To: <20220826084001.3341215-3-badhri@google.com>
Hi Badhri,
On Fri, Aug 26, 2022 at 01:40:00AM -0700, Badhri Jagan Sridharan wrote:
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
No commit message? I guess you want to do this because you want to
split the driver into several files. Please put that into your commit
message.
> ---
> drivers/usb/typec/tcpm/tcpci_maxim.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/typec/tcpm/tcpci_maxim.c b/drivers/usb/typec/tcpm/tcpci_maxim.c
> index 4b6705f3d7b7..af3a7ecab23b 100644
> --- a/drivers/usb/typec/tcpm/tcpci_maxim.c
> +++ b/drivers/usb/typec/tcpm/tcpci_maxim.c
> @@ -68,25 +68,29 @@ static struct max_tcpci_chip *tdata_to_max_tcpci(struct tcpci_data *tdata)
> return container_of(tdata, struct max_tcpci_chip, data);
> }
>
> -static int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val)
> +inline int max_tcpci_read16(struct max_tcpci_chip *chip, unsigned int reg, u16 *val)
> {
> return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u16));
> }
> +EXPORT_SYMBOL_GPL(max_tcpci_read16);
Hold on! You don't need to export these under any circumstance.
If you want to make these inline function, move them to a header.
Otherwise just make them non-static.
Either way, don't export them.
> -static int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val)
> +inline int max_tcpci_write16(struct max_tcpci_chip *chip, unsigned int reg, u16 val)
> {
> return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u16));
> }
> +EXPORT_SYMBOL_GPL(max_tcpci_write16);
>
> -static int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val)
> +inline int max_tcpci_read8(struct max_tcpci_chip *chip, unsigned int reg, u8 *val)
> {
> return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u8));
> }
> +EXPORT_SYMBOL_GPL(max_tcpci_read8);
>
> -static int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val)
> +inline int max_tcpci_write8(struct max_tcpci_chip *chip, unsigned int reg, u8 val)
> {
> return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u8));
> }
> +EXPORT_SYMBOL_GPL(max_tcpci_write8);
>
> static void max_tcpci_init_regs(struct max_tcpci_chip *chip)
> {
> --
> 2.37.2.672.g94769d06f0-goog
--
heikki
next prev parent reply other threads:[~2022-08-30 10:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 8:39 [PATCH v1 1/4] usb: typec: tcpm: Add callbacks to mitigate wakeups due to contaminant Badhri Jagan Sridharan
2022-08-26 8:39 ` [PATCH v1 2/4] usb: typec: tcpci: Add callback for evaluating contaminant presence Badhri Jagan Sridharan
2022-08-26 8:40 ` [PATCH v1 3/4] usb: typec: tcpci_maxim: Export helper function for register reads Badhri Jagan Sridharan
2022-08-30 10:57 ` Heikki Krogerus [this message]
2022-08-30 13:00 ` Greg Kroah-Hartman
2022-08-31 0:20 ` Badhri Jagan Sridharan
2022-08-26 8:40 ` [PATCH v1 4/4] usb: typec: maxim_contaminant: Implement check_contaminant callback Badhri Jagan Sridharan
2022-08-30 17:55 ` Guenter Roeck
2022-08-31 0:22 ` Badhri Jagan Sridharan
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=Yw3tLf6lcmtU1+t/@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=badhri@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
/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