linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Joakim Zhang <qiangqing.zhang@nxp.com>,
	Angelo Dureghello <angelo@kernel-space.org>
Cc: "gerg@linux-m68k.org" <gerg@linux-m68k.org>,
	"wg@grandegger.com" <wg@grandegger.com>,
	"mkl@pengutronix.de" <mkl@pengutronix.de>,
	"linux-m68k@vger.kernel.org" <linux-m68k@vger.kernel.org>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH 5/5] can: flexcan: add mcf5441x support
Date: Wed, 9 Jun 2021 10:12:35 +0200	[thread overview]
Message-ID: <CAMuHMdUeeH2BWgVRoVX7yfckY=wi8X3qkaH0THhVF_3FpZsbqg@mail.gmail.com> (raw)
In-Reply-To: <DB8PR04MB6795CE1FF40605F69E3A0040E6369@DB8PR04MB6795.eurprd04.prod.outlook.com>

Hi Joakim, Angelo,

On Wed, Jun 9, 2021 at 4:05 AM Joakim Zhang <qiangqing.zhang@nxp.com> wrote:
> > From: Angelo Dureghello <angelo@kernel-space.org>
> > Sent: 2021年6月9日 4:46
> > To: gerg@linux-m68k.org; wg@grandegger.com; mkl@pengutronix.de
> > Cc: geert@linux-m68k.org; linux-m68k@vger.kernel.org;
> > linux-can@vger.kernel.org; Joakim Zhang <qiangqing.zhang@nxp.com>;
> > Angelo Dureghello <angelo@kernel-space.org>
> > Subject: [PATCH 5/5] can: flexcan: add mcf5441x support
> >
> > Add flexcan support for NXP ColdFire mcf5441x family.
> >
> > This flexcan module is quite similar to imx6 flexcan module, but with some
> > exceptions:
> >
> > - 3 separate interrupt sources, MB, BOFF and ERR,
> > - implements 16 mb only,
> > - m68k architecture is not supporting devicetrees, so a
> >   platform data check/case has been added,
> > - ColdFire is m68k, so big-endian cpu, with a little-endian flexcan
> >   module.
> >
> > Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>

> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c

> > @@ -637,13 +650,17 @@ static int flexcan_clks_enable(const struct
> > flexcan_priv *priv)  {
> >       int err;
> >
> > -     err = clk_prepare_enable(priv->clk_ipg);
> > -     if (err)
> > -             return err;
> > +     if (priv->clk_ipg) {
> > +             err = clk_prepare_enable(priv->clk_ipg);
> > +             if (err)
> > +                     return err;
> > +     }
> >
> > -     err = clk_prepare_enable(priv->clk_per);
> > -     if (err)
> > -             clk_disable_unprepare(priv->clk_ipg);
> > +     if (priv->clk_per) {
> > +             err = clk_prepare_enable(priv->clk_per);
> > +             if (err)
> > +                     clk_disable_unprepare(priv->clk_ipg);
> > +     }
>
> No need do this check, it will be handled in clk_prepare_enable() / clk_disable_unprepare(). So this change is unnecessary.

Except that the non-CCF implementation of clk_enable() in
arch/m68k/coldfire/clk.c still returns -EINVAL instead of NULL.
Any plans to move to CCF? Or at least fix legacy clk_enable().

> > @@ -2091,6 +2133,11 @@ static int flexcan_probe(struct platform_device
> > *pdev)
> >
> >       devtype_data = of_device_get_match_data(&pdev->dev);
> >
> > +     if (pdata && !devtype_data) {
> > +             devtype_data =
> > +                     (struct flexcan_devtype_data *)&fsl_mcf_devtype_data;

Cast not needed?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2021-06-09  8:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 20:45 [PATCH 1/5] can: flexcan: add platform data for ColdFire Angelo Dureghello
2021-06-08 20:45 ` [PATCH 2/5] m68k: stmark2: update board setup Angelo Dureghello
2021-06-08 20:45 ` [PATCH 3/5] m68k: m5441x: add flexcan support Angelo Dureghello
2021-06-09 13:24   ` Greg Ungerer
2021-06-10  7:59     ` Angelo Dureghello
2021-06-11 12:38       ` Greg Ungerer
2021-06-08 20:45 ` [PATCH 4/5] can: flexcan: enable Kconfig for ColdFire Angelo Dureghello
2021-06-08 20:45 ` [PATCH 5/5] can: flexcan: add mcf5441x support Angelo Dureghello
2021-06-09  2:05   ` Joakim Zhang
2021-06-09  8:12     ` Geert Uytterhoeven [this message]
2021-06-09  8:42       ` Angelo Dureghello
2021-06-09 13:18       ` Greg Ungerer
2021-06-09  8:35     ` Angelo Dureghello
2021-06-09  8:56   ` Marc Kleine-Budde
2021-06-09  9:05     ` Angelo Dureghello
2021-06-09  2:05 ` [PATCH 1/5] can: flexcan: add platform data for ColdFire Joakim Zhang
2021-06-09  7:57   ` Angelo Dureghello
2021-06-09  8:14 ` Geert Uytterhoeven
2021-06-09  8:56   ` Angelo Dureghello

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='CAMuHMdUeeH2BWgVRoVX7yfckY=wi8X3qkaH0THhVF_3FpZsbqg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=angelo@kernel-space.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=qiangqing.zhang@nxp.com \
    --cc=wg@grandegger.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 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).