Re: [PATCH v3 6/7] OF: spi: Add overlay bus handler

From: Michael Stickel
Date: Thu Mar 20 2014 - 06:58:55 EST


Am 18.03.2014 22:56, schrieb Pantelis Antoniou:
> Add the bus handler registration needed for performing overlays
> containing spi devices.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@xxxxxxxxxxxx>
> ---
> drivers/spi/spi.c | 345 ++++++++++++++++++++++++++++++++++++++----------------
> 1 file changed, 242 insertions(+), 103 deletions(-)
>

nc is not set in of_register_spi_device and causes an Oops.
Using nc = node works.
What is the purpose of nc?

> +of_register_spi_device(struct spi_master *master, struct device_node *node)
> +{
> + struct spi_device *spi;
> + struct device_node *nc;
> + int err;
> + u32 value;
> +
> + /* Alloc an spi_device */
> + spi = spi_alloc_device(master);
> + if (!spi) {
> + dev_err(&master->dev, "spi_device alloc error for %s\n",
> + nc->full_name);
> + err = -ENOMEM;
> + goto err_out;
> + }
> +
> + /* Select device driver */
> + err = of_modalias_node(nc, spi->modalias,
> + sizeof(spi->modalias));
> + if (err) {
> + dev_err(&master->dev, "cannot find modalias for %s\n",
> + nc->full_name);
> + goto err_out;
> + }



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/