From: Nikita Shubin <nikita.shubin@maquefel.me>
To: opensbi@lists.infradead.org
Subject: [PATCH 1/2] platform: sifive_fu740: do not use a global in da9063_reset/shutdown
Date: Wed, 5 Jan 2022 16:16:19 +0300 [thread overview]
Message-ID: <20220105161619.00002773@maquefel.me> (raw)
In-Reply-To: <20220105072039.2609845-1-aurelien@aurel32.net>
Hello Aurelien!
On Wed, 5 Jan 2022 08:20:38 +0100
Aurelien Jarno <aurelien@aurel32.net> wrote:
Seems good to me.
Reviewed-by: Nikita Shubin <n.shubin@yadro.com>
> da9063_reset() and da9063_shutdown() take the chip address in argument
> (like similar functions), but in practice use the da9063 global struct
> instead. Fix that.
>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> platform/generic/sifive_fu740.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/platform/generic/sifive_fu740.c
> b/platform/generic/sifive_fu740.c index 333b3fb..866e924 100644
> --- a/platform/generic/sifive_fu740.c
> +++ b/platform/generic/sifive_fu740.c
> @@ -81,32 +81,32 @@ static inline int da9063_sanity_check(struct
> i2c_adapter *adap, uint32_t reg)
> static inline int da9063_shutdown(struct i2c_adapter *adap, uint32_t
> reg) {
> - int rc = i2c_adapter_reg_write(adap, da9063.reg,
> + int rc = i2c_adapter_reg_write(adap, reg,
> DA9063_REG_PAGE_CON, 0x00);
>
> if (rc)
> return rc;
>
> - return i2c_adapter_reg_write(adap, da9063.reg,
> + return i2c_adapter_reg_write(adap, reg,
> DA9063_REG_CONTROL_F,
> DA9063_CONTROL_F_SHUTDOWN);
> }
>
> static inline int da9063_reset(struct i2c_adapter *adap, uint32_t
> reg) {
> - int rc = i2c_adapter_reg_write(adap, da9063.reg,
> + int rc = i2c_adapter_reg_write(adap, reg,
> DA9063_REG_PAGE_CON, 0x00);
>
> if (rc)
> return rc;
>
> - rc = i2c_adapter_reg_write(adap, da9063.reg,
> + rc = i2c_adapter_reg_write(adap, reg,
> DA9063_REG_CONTROL_F,
> DA9063_CONTROL_F_WAKEUP);
> if (rc)
> return rc;
>
> - return i2c_adapter_reg_write(adap, da9063.reg,
> + return i2c_adapter_reg_write(adap, reg,
> DA9063_REG_CONTROL_A,
> DA9063_CONTROL_A_M_POWER1_EN |
> DA9063_CONTROL_A_M_POWER_EN |
next prev parent reply other threads:[~2022-01-05 13:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 7:20 [PATCH 1/2] platform: sifive_fu740: do not use a global in da9063_reset/shutdown Aurelien Jarno
2022-01-05 7:20 ` [PATCH 2/2] platform: sifive_fu740: fix reset when watchdog is running Aurelien Jarno
2022-01-05 13:39 ` Nikita Shubin
2022-01-05 16:16 ` David Abdurachmanov
[not found] ` <77e2fbd5-aad6-b49b-0559-4f411e42d6d2@ghiti.fr>
2022-01-05 16:45 ` Fwd: " Heinrich Schuchardt
2022-01-05 16:51 ` Aurelien Jarno
2022-01-06 13:10 ` Nikita Shubin
2022-01-19 17:05 ` David Abdurachmanov
2022-01-21 16:22 ` Anup Patel
2022-01-05 13:16 ` Nikita Shubin [this message]
2022-01-06 1:26 ` [PATCH 1/2] platform: sifive_fu740: do not use a global in da9063_reset/shutdown Xiang W
2022-01-21 16:21 ` Anup Patel
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=20220105161619.00002773@maquefel.me \
--to=nikita.shubin@maquefel.me \
--cc=opensbi@lists.infradead.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