From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Angelo Dureghello <angelo@kernel-space.org>
Cc: gerg@linux-m68k.org, wg@grandegger.com, geert@linux-m68k.org,
linux-m68k@vger.kernel.org, linux-can@vger.kernel.org,
qiangqing.zhang@nxp.com
Subject: Re: [PATCH v4 5/5] can: flexcan: add mcf5441x support
Date: Thu, 1 Jul 2021 08:50:16 +0200 [thread overview]
Message-ID: <20210701065016.4joc3knflf7foi2k@pengutronix.de> (raw)
In-Reply-To: <20210630230016.4099050-5-angelo@kernel-space.org>
[-- Attachment #1: Type: text/plain, Size: 1932 bytes --]
On 01.07.2021 01:00:16, Angelo Dureghello wrote:
[...]
> @@ -2089,7 +2151,14 @@ static int flexcan_probe(struct platform_device *pdev)
> if (IS_ERR(regs))
> return PTR_ERR(regs);
>
> - devtype_data = of_device_get_match_data(&pdev->dev);
> + of_id = of_match_device(flexcan_of_match, &pdev->dev);
> + if (of_id)
> + devtype_data = of_id->data;
> + else if (platform_get_device_id(pdev)->driver_data)
> + devtype_data = (struct flexcan_devtype_data *)
> + platform_get_device_id(pdev)->driver_data;
> + else
> + return -ENODEV;
>
> if ((devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) &&
> !(devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)) {
> @@ -2133,6 +2202,15 @@ static int flexcan_probe(struct platform_device *pdev)
> priv->devtype_data = devtype_data;
> priv->reg_xceiver = reg_xceiver;
>
> + if (devtype_data->quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
> + priv->irq_boff = platform_get_irq(pdev, 1);
> + if (priv->irq_boff <= 0)
> + return -ENODEV;
I'm missing error handling here.
> + priv->irq_err = platform_get_irq(pdev, 2);
> + if (priv->irq_err <= 0)
> + return -ENODEV;
I'm missing error handling here.
> + }
> +
> if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) {
> priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD |
> CAN_CTRLMODE_FD_NON_ISO;
> @@ -2322,6 +2400,7 @@ static struct platform_driver flexcan_driver = {
> },
> .probe = flexcan_probe,
> .remove = flexcan_remove,
> + .id_table = flexcan_id_table,
> };
>
> module_platform_driver(flexcan_driver);
Please add error handling then I think the patch can be merged.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-07-01 6:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 23:00 [PATCH v4 1/5] can: flexcan: add platform data header Angelo Dureghello
2021-06-30 23:00 ` [PATCH v4 2/5] m68k: stmark2: update board setup Angelo Dureghello
2021-07-01 6:53 ` Marc Kleine-Budde
2021-07-01 7:41 ` Greg Ungerer
2021-07-01 7:42 ` Marc Kleine-Budde
2021-07-01 8:02 ` Greg Ungerer
2021-07-01 9:10 ` Geert Uytterhoeven
2021-07-01 9:37 ` Marc Kleine-Budde
2021-07-02 9:35 ` Angelo Dureghello
2021-06-30 23:00 ` [PATCH v4 3/5] m68k: m5441x: add flexcan support Angelo Dureghello
2021-06-30 23:00 ` [PATCH v4 4/5] can: flexcan: update Kconfig to enable coldfire Angelo Dureghello
2021-07-01 9:02 ` Marc Kleine-Budde
2021-06-30 23:00 ` [PATCH v4 5/5] can: flexcan: add mcf5441x support Angelo Dureghello
2021-07-01 6:50 ` Marc Kleine-Budde [this message]
2021-07-01 9:27 ` [PATCH v4 1/5] can: flexcan: add platform data header Marc Kleine-Budde
2021-07-02 9:21 ` Angelo Dureghello
2021-07-02 9:55 ` Marc Kleine-Budde
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=20210701065016.4joc3knflf7foi2k@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=angelo@kernel-space.org \
--cc=geert@linux-m68k.org \
--cc=gerg@linux-m68k.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-m68k@vger.kernel.org \
--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