From patchwork Fri Jun 24 14:20:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Suchanek X-Patchwork-Id: 9197611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 097BB6077D for ; Fri, 24 Jun 2016 14:21:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEE3E284B0 for ; Fri, 24 Jun 2016 14:21:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E342D284B9; Fri, 24 Jun 2016 14:21:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81036284B0 for ; Fri, 24 Jun 2016 14:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbcFXOVG (ORCPT ); Fri, 24 Jun 2016 10:21:06 -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 Received: by mail-wm0-f67.google.com with SMTP id r201so5408446wme.0; Fri, 24 Jun 2016 07:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=xY4UliWsUOII7EUk1fMW2Go/z8RnhdDR5Thq0qkNl3g=; b=Y/iGQ2ETSaaWdzIaq6jhCIVy9VLOiGGlt0NTu4wzfn+aAanxiOw184TQM8yn0ynYYH +OXp0TyYPKatrulcrpfmMhCd5XjrXRKYlY61FAZ/avy+pZGIC4a4nBAAF0HkG2C+DYDo SvT1OAgsVEiYY/G6bPaAnizzkFQgt/R0txA+k3mviHM4/6eRw6vMY9WIXshnQgE7JJRh l5TMwGbAt10lOz00Ruxh1+2mn3Qt4dhNzJVxMH80m/qSBsWw/lbtSEAuz4mSoIsWpKoN US0B1DHgv7c0m6qp1VDItNh6BWz/I66NZ6sHqXgqiNDqozXRBm7R1CBEWaEjNq7LKFu4 RySg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=xY4UliWsUOII7EUk1fMW2Go/z8RnhdDR5Thq0qkNl3g=; b=B3su+XbzDIssDtm2mIfU7LKBEWvlIC4louG5ffsGmcmN9AEffOiQiI9b4GQm3o59sU 1RI7DXgjTMX8YHyv1U6kSLVUnSxYxYlCtqtI0G0Dz9OAvlJjiH11xfUxT9Ib3WmOaqts tYakcSo4GTESAEChcsaLNUl7OoBo7HzUBN/AdWmLfGF+GL1xTuTcNeMBKVnhv5Hxqq7A LvTnu6n7k3QG9Mo2B2Q1hp6uzAkMmAfn8YSGAe4pJUY6lxPtwt9wQSjFgJnZnBeSHgRi VWUqztKALrF5bn1Qzs1jfODtD1qznrmz6+5KaRRtn434/h3LisK2yyfwwY6T2Xva4AL+ qZog== X-Gm-Message-State: ALyK8tJyq84Ve9OkZ3oSfkuzErqYXfFjY1sqDdC1u9zpwWLoE5VSfig8WRiSHRhXxjiglg== X-Received: by 10.194.157.162 with SMTP id wn2mr4529340wjb.103.1466778058269; Fri, 24 Jun 2016 07:20:58 -0700 (PDT) Received: from iscsi.burning-in.hell ([179.43.146.230]) by smtp.gmail.com with ESMTPSA id 124sm3369074wml.12.2016.06.24.07.20.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 07:20:57 -0700 (PDT) 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-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);