# Re: \[linux-nfc\] \[PATCH v3 1/2\] NFC: pn544\_i2c: Add device-tree (Open Firmware) support to PN544

- From: Samuel Ortiz \<hidden\>
- Date: 2014-03-31 23:48:59 
- List: linux-devicetree
- Page: https://ratatoskr.run/linux-devicetree/2014/03/8088352
- Thread: https://ratatoskr.run/linux-devicetree/2014/03/8088352/t.md

```text
Hi Clement,

One more comment:

On Mon, Mar 31, 2014 at 12:21:44PM +0000, Clement Perrochaud wrote:
> +	/* No platform data, using device tree. */
> +	if (!pdata && client->dev.of_node) {
> +		r = pn544_hci_i2c_of_request_resources(client);
> +		if (r) {
> +			nfc_err(&client->dev, "No DT data\n");
> +			return r;
> +		}
> +	/* Using platform data. */
> +	} else {
That should be: } else if (pdata) {
as you need to check for pdata before dereferencing it.
And your final else will handle the error case where both pdata and of_node
are NULL.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
