linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: Prashant Malani <pmalani@chromium.org>, linux-kernel@vger.kernel.org
Cc: kbuild test robot <lkp@intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Guenter Roeck <groeck@chromium.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Sebastian Reichel <sre@kernel.org>,
	"open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)" 
	<linux-media@vger.kernel.org>
Subject: Re: [PATCH v2 15/17] media: cros-ec-cec: Use cros_ec_cmd()
Date: Wed, 24 Jun 2020 14:04:49 +0200	[thread overview]
Message-ID: <9f4cd932-c7ec-c755-17f3-503327450256@xs4all.nl> (raw)
In-Reply-To: <20200205190028.183069-16-pmalani@chromium.org>

Hi Prashant,

On 05/02/2020 20:00, Prashant Malani wrote:
> Replace cros_ec_cmd_xfer_status() with cros_ec_cmd() which does the
> message buffer setup and cleanup, but is located in platform/chrome
> and used by other drivers.
> 
> Signed-off-by: Prashant Malani <pmalani@chromium.org>
> Reported-by: kbuild test robot <lkp@intel.com>

This source has moved to drivers/media/cec/platform/cros-ec/cros-ec-cec.c.

Can you rebase/repost?

Regards,

	Hans

> ---
> 
> Changes in v2:
> - Updated to use new function name and parameter list.
> - Used C99 element setting to initialize struct.
> 
>  .../media/platform/cros-ec-cec/cros-ec-cec.c  | 45 +++++++------------
>  1 file changed, 16 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
> index 0e7e2772f08f96..a462af1c9ae04b 100644
> --- a/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
> +++ b/drivers/media/platform/cros-ec-cec/cros-ec-cec.c
> @@ -93,18 +93,14 @@ static int cros_ec_cec_set_log_addr(struct cec_adapter *adap, u8 logical_addr)
>  {
>  	struct cros_ec_cec *cros_ec_cec = adap->priv;
>  	struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec;
> -	struct {
> -		struct cros_ec_command msg;
> -		struct ec_params_cec_set data;
> -	} __packed msg = {};
> +	struct ec_params_cec_set data = {
> +		.cmd = CEC_CMD_LOGICAL_ADDRESS,
> +		.val = logical_addr,
> +	};
>  	int ret;
>  
> -	msg.msg.command = EC_CMD_CEC_SET;
> -	msg.msg.outsize = sizeof(msg.data);
> -	msg.data.cmd = CEC_CMD_LOGICAL_ADDRESS;
> -	msg.data.val = logical_addr;
> -
> -	ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
> +	ret = cros_ec_cmd(cros_ec, 0, EC_CMD_CEC_SET, &data, sizeof(data),
> +			  NULL, 0, NULL);
>  	if (ret < 0) {
>  		dev_err(cros_ec->dev,
>  			"error setting CEC logical address on EC: %d\n", ret);
> @@ -119,17 +115,12 @@ static int cros_ec_cec_transmit(struct cec_adapter *adap, u8 attempts,
>  {
>  	struct cros_ec_cec *cros_ec_cec = adap->priv;
>  	struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec;
> -	struct {
> -		struct cros_ec_command msg;
> -		struct ec_params_cec_write data;
> -	} __packed msg = {};
> +	struct ec_params_cec_write data = {};
>  	int ret;
>  
> -	msg.msg.command = EC_CMD_CEC_WRITE_MSG;
> -	msg.msg.outsize = cec_msg->len;
> -	memcpy(msg.data.msg, cec_msg->msg, cec_msg->len);
> -
> -	ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
> +	memcpy(data.msg, cec_msg->msg, cec_msg->len);
> +	ret = cros_ec_cmd(cros_ec, 0, EC_CMD_CEC_WRITE_MSG, &data,
> +			  sizeof(cec_msg->len), NULL, 0, NULL);
>  	if (ret < 0) {
>  		dev_err(cros_ec->dev,
>  			"error writing CEC msg on EC: %d\n", ret);
> @@ -143,18 +134,14 @@ static int cros_ec_cec_adap_enable(struct cec_adapter *adap, bool enable)
>  {
>  	struct cros_ec_cec *cros_ec_cec = adap->priv;
>  	struct cros_ec_device *cros_ec = cros_ec_cec->cros_ec;
> -	struct {
> -		struct cros_ec_command msg;
> -		struct ec_params_cec_set data;
> -	} __packed msg = {};
> +	struct ec_params_cec_set data = {
> +		.cmd = CEC_CMD_ENABLE,
> +		.val = enable,
> +	};
>  	int ret;
>  
> -	msg.msg.command = EC_CMD_CEC_SET;
> -	msg.msg.outsize = sizeof(msg.data);
> -	msg.data.cmd = CEC_CMD_ENABLE;
> -	msg.data.val = enable;
> -
> -	ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
> +	ret = cros_ec_cmd(cros_ec, 0, EC_CMD_CEC_SET, &data, sizeof(data),
> +			  NULL, 0, NULL);
>  	if (ret < 0) {
>  		dev_err(cros_ec->dev,
>  			"error %sabling CEC on EC: %d\n",
> 


      reply	other threads:[~2020-06-24 12:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200205190028.183069-1-pmalani@chromium.org>
2020-02-05 18:59 ` [PATCH v2 02/17] platform/chrome: chardev: Use cros_ec_cmd() Prashant Malani
2020-02-05 18:59 ` [PATCH v2 03/17] platform/chrome: proto: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 04/17] platform/chrome: usbpd_logger: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 05/17] platform/chrome: sensorhub: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 06/17] platform/chrome: debugfs: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 07/17] platform/chrome: sysfs: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 08/17] extcon: cros_ec: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 09/17] hid: google-hammer: " Prashant Malani
2020-02-05 19:00 ` [PATCH v2 10/17] iio: cros_ec: " Prashant Malani
2020-02-05 19:42   ` Gwendal Grignou
2020-02-06 12:17   ` Jonathan Cameron
2020-02-06 13:45     ` Enric Balletbo i Serra
2020-02-06 18:49       ` Prashant Malani
2020-02-07 18:47         ` Gwendal Grignou
2020-02-10 11:03           ` Enric Balletbo i Serra
2020-02-10 20:14             ` Prashant Malani
2020-02-18 18:30               ` Prashant Malani
2020-02-20 16:07                 ` Enric Balletbo i Serra
2020-02-25  1:26                   ` Prashant Malani
2020-02-05 19:00 ` [PATCH v2 11/17] ASoC: cros_ec_codec: " Prashant Malani
2020-02-06 11:53   ` Mark Brown
2020-02-05 19:00 ` [PATCH v2 12/17] power: supply: cros: " Prashant Malani
2020-02-24 17:13   ` Sebastian Reichel
2020-02-05 19:00 ` [PATCH v2 13/17] pwm: cros-ec: Remove cros_ec_cmd_xfer_status() Prashant Malani
2020-02-05 19:00 ` [PATCH v2 14/17] rtc: cros-ec: Use cros_ec_cmd() Prashant Malani
2020-02-05 20:04   ` Alexandre Belloni
2020-02-05 19:00 ` [PATCH v2 15/17] media: cros-ec-cec: " Prashant Malani
2020-06-24 12:04   ` Hans Verkuil [this message]

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=9f4cd932-c7ec-c755-17f3-503327450256@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bleung@chromium.org \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mchehab@kernel.org \
    --cc=pmalani@chromium.org \
    --cc=sre@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).