All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rui Miguel Silva <rmfrfs@gmail.com>
To: Fabio Estevam <festevam@gmail.com>
Cc: hverkuil-cisco@xs4all.nl, p.zabel@pengutronix.de,
	slongerbeam@gmail.com, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/3] media: imx7-media-csi: Use functions instead of macros
Date: Mon, 03 Jun 2019 18:48:25 +0100	[thread overview]
Message-ID: <m3h896a7bq.fsf@gmail.com> (raw)
In-Reply-To: <20190601175140.16305-1-festevam@gmail.com>

Oi Fabio,
On Sat 01 Jun 2019 at 18:51, Fabio Estevam wrote:
> Currently there is a macro for reading and another macro for writing
> to the CSI registers.
>
> Functions can do parameter type checking, which leads to a safer code,
> so switch from macro to function implementation.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
>

Thanks for the patches. for all of them:
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

---
Cheers,
        Rui

> ---
>  drivers/staging/media/imx/imx7-media-csi.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
> index b1af8694899e..8abdf253696d 100644
> --- a/drivers/staging/media/imx/imx7-media-csi.c
> +++ b/drivers/staging/media/imx/imx7-media-csi.c
> @@ -195,10 +195,16 @@ struct imx7_csi {
>  	struct completion last_eof_completion;
>  };
>
> -#define imx7_csi_reg_read(_csi, _offset) \
> -	__raw_readl((_csi)->regbase + (_offset))
> -#define imx7_csi_reg_write(_csi, _val, _offset) \
> -	__raw_writel(_val, (_csi)->regbase + (_offset))
> +static u32 imx7_csi_reg_read(struct imx7_csi *csi, unsigned int offset)
> +{
> +	return readl(csi->regbase + offset);
> +}
> +
> +static void imx7_csi_reg_write(struct imx7_csi *csi, unsigned int value,
> +			       unsigned int offset)
> +{
> +	writel(value, csi->regbase + offset);
> +}
>
>  static void imx7_csi_hw_reset(struct imx7_csi *csi)
>  {


      parent reply	other threads:[~2019-06-03 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-01 17:51 [PATCH 1/3] media: imx7-media-csi: Use functions instead of macros Fabio Estevam
2019-06-01 17:51 ` [PATCH 2/3] media: imx7-media-csi: Use u32 for storing register reads Fabio Estevam
2019-06-01 17:51 ` [PATCH 3/3] media: imx7-media-csi: Remove unneeded error message Fabio Estevam
2019-06-03 17:48 ` Rui Miguel Silva [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=m3h896a7bq.fsf@gmail.com \
    --to=rmfrfs@gmail.com \
    --cc=festevam@gmail.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=slongerbeam@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.