From patchwork Thu Sep 20 19:18:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 10608637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EADAC6CB for ; Thu, 20 Sep 2018 19:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D85132E3FA for ; Thu, 20 Sep 2018 19:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC1FF2E3FD; Thu, 20 Sep 2018 19:21:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 696752E3FA for ; Thu, 20 Sep 2018 19:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388103AbeIUBG4 (ORCPT ); Thu, 20 Sep 2018 21:06:56 -0400 Received: from mail-eopbgr690137.outbound.protection.outlook.com ([40.107.69.137]:14528 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388652AbeIUBDf (ORCPT ); Thu, 20 Sep 2018 21:03:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=impinj.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=feKl8UWgFbkKNusXRdWBSGHV9xipaEprRZyuvuljcIE=; b=W7scr4YDk2Wi11qH+Bis63p26U0ggTsKMuoNuoRp/r8hBLMGT+Avs4+gt/8G0MDY/wsE+u394wAbD1taBWlQeZqQuPMmPJyUPc8yERqK6UmTL5jMXAQ2moqm4t2emK6uEkKkGmpceDEIB1V8hErQCaowURBn6bLA5bZ89Xy3wm0= Received: from MWHPR0601MB3708.namprd06.prod.outlook.com (10.167.236.38) by MWHPR0601MB3675.namprd06.prod.outlook.com (10.167.236.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Thu, 20 Sep 2018 19:18:34 +0000 Received: from MWHPR0601MB3708.namprd06.prod.outlook.com ([fe80::eca3:1c00:bc20:bc48]) by MWHPR0601MB3708.namprd06.prod.outlook.com ([fe80::eca3:1c00:bc20:bc48%4]) with mapi id 15.20.1143.019; Thu, 20 Sep 2018 19:18:34 +0000 From: Trent Piepho To: "linux-spi@vger.kernel.org" CC: Henry Gomersall , Geert Uytterhoeven , Kyle Roeschley , Mark Brown , Trent Piepho Subject: [PATCH v2 3/3] spi: spidev: Fix OF tree warning logic Thread-Topic: [PATCH v2 3/3] spi: spidev: Fix OF tree warning logic Thread-Index: AQHUURa5AT2guZ8UU0ir5ssVB9H8oQ== Date: Thu, 20 Sep 2018 19:18:34 +0000 Message-ID: <20180920191759.17781-4-tpiepho@impinj.com> References: <20180920191759.17781-1-tpiepho@impinj.com> In-Reply-To: <20180920191759.17781-1-tpiepho@impinj.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DM5PR13CA0026.namprd13.prod.outlook.com (2603:10b6:3:7b::12) To MWHPR0601MB3708.namprd06.prod.outlook.com (2603:10b6:301:7c::38) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [216.207.205.253] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR0601MB3675;6:weZdRCgKtzxt28RQVRvKnp47VWAyidDtKq3UWymJ6TpFMh2lmKs5Hvj+gRQISQVT0VHj2d0hISUsYxIuJQo9hFwB5Y5p/ypsPl//rYSf2qCs9prYBTMyBvGBc+yP2mlFR0s5FJoLcTOyN0dIHue9aoz6uHXDt14K5JgsBZHQKXDWnm+OfBJ5x/ya8tEXmNTMCHg/Pet0RDWuF5jQWXYrUYhhmobfqfml63EVAXLSPfVOA/2pT8htGUWPw+aCvlKQFSzkMJK/Do/Bbuj3QI9gJoxgVpqIbanhhSOmNLNjItcrBFiDL0wpeGM5dOz7G2I4Ki7FPx8XAyMAxj0fFQh6cd1rDHFCqaNUll+DtaPxWZG9YZ//7GvuSvePT7pA/NpU6cUwp7a/2ZfLg+0p449NUfgedS12FuHXy0rpLfl/EDb8HLcRxK+/vKTG9V2mlp/3VD0gu1bh/nUPjkeZZ1VG+A==;5:+Bo269KdGe9J+plxmyCn4SV4Gi0XhrA3IKUgwT5G8j75ogzcee2f4v8O/803+7LfATz92PEUI5y5YgoV2fzqZtd+4L3fuexcc25dJmYg7zO0ZFJ/5uOoNGRDjFiwbJi6oYdFo1NxcfUKh5sveX24SnUzDgz8ft1tzKhslIrUALc=;7:Jji5f4sR/C3TvOv/YSmay78G2FM8d/e/QXGNaMvhJ0qrATooxsj5T/rgNyTalfLe4bnqgTOTE483rl3NA/mwclxLlCXFSvOFZqumeax4gBtCqFO7q9Pq9Pd4rLe9z0US8x6YaqCZTuDOHMK8Yb4xUia2xw0uTsHd1PtKiQ5d2nREFKNVckL2tYpIsUfIoeb/7P96OOacgYsy2mIaQyxFQDYatwQMdU7ficVKVtAPCD7/eD7seUCG/UAacq+l+5nZ x-ms-office365-filtering-correlation-id: 0e97d287-2dea-4bed-e9d2-08d61f2ddbf2 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:MWHPR0601MB3675; x-ms-traffictypediagnostic: MWHPR0601MB3675: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991041);SRVR:MWHPR0601MB3675;BCL:0;PCL:0;RULEID:;SRVR:MWHPR0601MB3675; x-forefront-prvs: 0801F2E62B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39850400004)(396003)(376002)(346002)(136003)(366004)(199004)(189003)(4326008)(3846002)(6512007)(5250100002)(6116002)(76176011)(36756003)(2501003)(53936002)(1076002)(2906002)(99286004)(52116002)(316002)(54906003)(81166006)(81156014)(5660300001)(105586002)(106356001)(2351001)(97736004)(14454004)(2900100001)(8936002)(8676002)(71190400001)(71200400001)(478600001)(305945005)(7736002)(6916009)(66066001)(86362001)(256004)(186003)(6346003)(26005)(486006)(102836004)(386003)(11346002)(6506007)(5640700003)(6436002)(68736007)(446003)(476003)(2616005)(6486002)(107886003)(25786009);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR0601MB3675;H:MWHPR0601MB3708.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: impinj.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; x-microsoft-antispam-message-info: zykuDeZD3wd/2YnnVPnHvtVj3vmTLGGFd8rYBZS0N0y5sYY8a0Nd9iVIJlOPeau5r6e3EreY29W+2pmVY4a/1QpUx94NZI1VtxG8YmtMn/WqQoV6ACMmCPv33L7sbgltNy/nG5HSKFIHqR1k0YLfbH4HCeU7XZtuRuu+qbwZmkkJW/8PNChospmwqqMM9NaX49TlBtW3SlfPbUAAYMZiDh3Al7vjFDTbvjr1LFPz0WDNH3B0W1DSRdERcwqeYh4Jc324Tq8F8H/fnkNVUbVLRo5S2MDbqHcRuriDb1xzwRbsrJtoTIcD0eLyrJA74ukwe46QVWj3Ntv3MQMBSUlXvyp/84/SU/uNlmjUDYS7XqU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e97d287-2dea-4bed-e9d2-08d61f2ddbf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Sep 2018 19:18:34.7455 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0601MB3675 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 spidev will make a big fuss if a device tree node binds a device by using "spidev" as the node's compatible property. However, the logic for this isn't looking for "spidev" in the compatible, but rather checking that the device is NOT compatible with spidev's list of devices. This causes a false positive if a device not named "rohm,dh2228fv", etc. binds to spidev, even if a means other than putting "spidev" in the device tree was used. E.g., the sysfs driver_override attribute. Signed-off-by: Trent Piepho Reviewed-by: Jan Kundrát Tested-by: Jan Kundrát Reviewed-by: Geert Uytterhoeven --- drivers/spi/spidev.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index cda10719d1d1..c5fe08bc34a0 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -724,11 +724,9 @@ static int spidev_probe(struct spi_device *spi) * compatible string, it is a Linux implementation thing * rather than a description of the hardware. */ - if (spi->dev.of_node && !of_match_device(spidev_dt_ids, &spi->dev)) { - dev_err(&spi->dev, "buggy DT: spidev listed directly in DT\n"); - WARN_ON(spi->dev.of_node && - !of_match_device(spidev_dt_ids, &spi->dev)); - } + WARN(spi->dev.of_node && + of_device_is_compatible(spi->dev.of_node, "spidev"), + "%pOF: buggy DT: spidev listed directly in DT\n", spi->dev.of_node); spidev_probe_acpi(spi);