From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbcFXOVH (ORCPT ); Fri, 24 Jun 2016 10:21:07 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33109 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbcFXOVE (ORCPT ); Fri, 24 Jun 2016 10:21:04 -0400 From: Michal Suchanek To: Greg Kroah-Hartman , Mark Brown , Ingo Molnar , Andrew Morton , Kees Cook , Thomas Gleixner , Dan Williams , Tejun Heo , "Paul E. McKenney" , Davidlohr Bueso , Andrey Ryabinin , Nikolay Aleksandrov , Dmitry Vyukov , Adrien Schildknecht , linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Cc: Michal Suchanek Subject: [PATCH 2/3] spi: of: allow instantiating slaves without a driver Date: Fri, 24 Jun 2016 16:20:33 +0200 Message-Id: X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SPI slave devices are not created when looking up driver for the slave fails. Create a device anyway so it can be manually bound to a driver. Signed-off-by: Michal Suchanek --- drivers/spi/spi.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 0239b45..73b1125 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1477,9 +1477,8 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc) rc = of_modalias_node(nc, spi->modalias, sizeof(spi->modalias)); if (rc < 0) { - dev_err(&master->dev, "cannot find modalias for %s\n", + dev_warn(&master->dev, "cannot find modalias for %s\n", nc->full_name); - goto err_out; } /* Device address */ @@ -1543,11 +1542,10 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc) /* Device speed */ rc = of_property_read_u32(nc, "spi-max-frequency", &value); if (rc) { - dev_err(&master->dev, "%s has no valid 'spi-max-frequency' property (%d)\n", + dev_warn(&master->dev, "%s has no valid 'spi-max-frequency' property (%d)\n", nc->full_name, rc); - goto err_out; - } - spi->max_speed_hz = value; + } else + spi->max_speed_hz = value; /* Store a pointer to the node in the device structure */ of_node_get(nc); -- 2.8.1