[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <569F5FDD.7050703@pengutronix.de>
Date: Wed, 20 Jan 2016 11:22:21 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Damien Riegel <damien.riegel@...oirfairelinux.com>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v4 1/3] can: sja1000: of: add per-compatible init hook
On 01/13/2016 04:57 PM, Damien Riegel wrote:
>> static int sp_probe(struct platform_device *pdev)
>> {
>> int err, irq = 0;
>> @@ -163,6 +177,9 @@ static int sp_probe(struct platform_device *pdev)
>> struct resource *res_mem, *res_irq = NULL;
>> struct sja1000_platform_data *pdata;
>> struct device_node *of = pdev->dev.of_node;
>> + const struct of_device_id *of_id;
>> + const struct sja1000_of_data *of_data = NULL;
>> + size_t priv_sz = 0;
>>
>> pdata = dev_get_platdata(&pdev->dev);
>> if (!pdata && !of) {
>> @@ -191,7 +208,13 @@ static int sp_probe(struct platform_device *pdev)
>> if (!irq && !res_irq)
>> return -ENODEV;
>>
>> - dev = alloc_sja1000dev(0);
>> + of_id = of_match_device(sp_of_table, &pdev->dev);
>> + if (of_id) {
>
> My personal preference here would be to test of_id && of_id->data. That
> way, we could avoid the declaration of nxp_data. It would also be a bit
> less error prone if someone adds a new compatible in the of device
> table.
Ok - please test v5.
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Download attachment "signature.asc" of type "application/pgp-signature" (456 bytes)
Powered by blists - more mailing lists