devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Cc: azkali <a.ffcc7@gmail.com>, Adam Jiang <chaoj@nvidia.com>,
	CTCaer <ctcaer@gmail.com>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Derek Kiernan <derek.kiernan@amd.com>,
	Dragan Cvetic <dragan.cvetic@amd.com>,
	Arnd Bergmann <arnd@arndb.de>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] misc: bm92txx: Add driver for the ROHM BM92Txx
Date: Thu, 24 Aug 2023 17:40:27 +0200	[thread overview]
Message-ID: <2023082402-rearview-babbling-257c@gregkh> (raw)
In-Reply-To: <20230824153059.212244-3-linkmauve@linkmauve.fr>

On Thu, Aug 24, 2023 at 05:30:54PM +0200, Emmanuel Gil Peyrot wrote:
> From: azkali <a.ffcc7@gmail.com>
> 
> This is used as the USB-C Power Delivery controller of the Nintendo
> Switch.
> 
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> Signed-off-by: azkali <a.ffcc7@gmail.com>
> Signed-off-by: Adam Jiang <chaoj@nvidia.com>
> Signed-off-by: CTCaer <ctcaer@gmail.com>
> ---
>  MAINTAINERS            |    1 +
>  drivers/misc/Kconfig   |   11 +
>  drivers/misc/Makefile  |    1 +
>  drivers/misc/bm92txx.c | 2403 ++++++++++++++++++++++++++++++++++++++++

Why here and not in drivers/usb/typec/ ?

>  4 files changed, 2416 insertions(+)
>  create mode 100644 drivers/misc/bm92txx.c
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index cc100a02fa7b..fe80d7693944 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -18457,6 +18457,7 @@ ROHM USB-C POWER DELIVERY CONTROLLERS
>  M:	Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
>  S:	Supported
>  F:	Documentation/devicetree/bindings/misc/rohm,bm92txx.yaml
> +F:	drivers/misc/bm92txx.c
>  
>  ROSE NETWORK LAYER
>  M:	Ralf Baechle <ralf@linux-mips.org>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 75e427f124b2..a2483819766a 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -561,6 +561,17 @@ config TPS6594_PFSM
>  	  This driver can also be built as a module.  If so, the module
>  	  will be called tps6594-pfsm.
>  
> +config BM92TXX
> +	tristate "Rohm Semiconductor BM92TXX USB Type-C Support"
> +	depends on I2C=y

Why =y?  That shouldn't matter, can't this just read:
	depends on I2C

> +static int bm92t_read_reg(struct bm92t_info *info,
> +			  unsigned char reg, unsigned char *buf, int num)
> +{
> +	struct i2c_msg xfer_msg[2];
> +	int err;
> +	unsigned char reg_addr;
> +
> +	reg_addr = reg;
> +
> +	xfer_msg[0].addr = info->i2c_client->addr;
> +	xfer_msg[0].len = 1;
> +	xfer_msg[0].flags = 0;
> +	xfer_msg[0].buf = &reg_addr;
> +
> +	xfer_msg[1].addr = info->i2c_client->addr;
> +	xfer_msg[1].len = num;
> +	xfer_msg[1].flags = I2C_M_RD;
> +	xfer_msg[1].buf = buf;
> +
> +	err = i2c_transfer(info->i2c_client->adapter, xfer_msg, 2);
> +	if (err < 0)
> +		dev_err(&info->i2c_client->dev, "%s: transfer error %d\n", __func__, err);

There shouldn't be a need to put __func__ in a dev_*() call.

And why not use the device you have here, not the i2c client device?
Isn't the platform device the "correct" one that had the error?

thanks,

greg k-h

  reply	other threads:[~2023-08-24 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24 15:30 [PATCH 0/2] Add a driver for the ROHM BM92Txx USB-C Power Delivery controller Emmanuel Gil Peyrot
2023-08-24 15:30 ` [PATCH 1/2] dt-bindings: misc: rohm,bm92txx: Add BM92Txx support Emmanuel Gil Peyrot
2023-08-24 16:16   ` Krzysztof Kozlowski
2023-08-24 15:30 ` [PATCH 2/2] misc: bm92txx: Add driver for the ROHM BM92Txx Emmanuel Gil Peyrot
2023-08-24 15:40   ` Greg Kroah-Hartman [this message]
2023-08-24 16:26   ` Krzysztof Kozlowski
2023-08-24 16:28   ` Krzysztof Kozlowski
2023-08-28 15:06     ` Emmanuel Gil Peyrot
2023-08-28 17:05       ` Krzysztof Kozlowski
2023-08-28 17:08         ` Krzysztof Kozlowski
2023-08-25 18:24   ` kernel test robot
2023-08-25 18:45   ` kernel test robot

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=2023082402-rearview-babbling-257c@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=a.ffcc7@gmail.com \
    --cc=arnd@arndb.de \
    --cc=chaoj@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=ctcaer@gmail.com \
    --cc=derek.kiernan@amd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dragan.cvetic@amd.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linkmauve@linkmauve.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.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).