From patchwork Tue Sep 18 22:50:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 10604975 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 743D8157B for ; Tue, 18 Sep 2018 22:50:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62F862BDCD for ; Tue, 18 Sep 2018 22:50:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5699D2BEFF; Tue, 18 Sep 2018 22:50:39 +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 0294E2BDCD for ; Tue, 18 Sep 2018 22:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725817AbeISEZZ (ORCPT ); Wed, 19 Sep 2018 00:25:25 -0400 Received: from mail-cys01nam02on0127.outbound.protection.outlook.com ([104.47.37.127]:64416 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726648AbeISEZZ (ORCPT ); Wed, 19 Sep 2018 00:25:25 -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=0QcrmQ0qchKMv6iwAZBhmEKyh9zb7QFXx3xvUgZoav8=; b=N362JahJfNuZgI53iSSU+HurGH/zsIiUqox8Gd64yM88FpfwxPUZC3SDeDm5itm5M8KZnC11JPIN2gir8Zsbm9xjLPwPAB05MgRY51J3yVxIf7OlLoQPRgjCdIbPmAqz5Z8D1aGXkF/OTWph/RX/dv9UHsYJTBpVTB8QwvI0Aqk= Received: from MWHPR0601MB3708.namprd06.prod.outlook.com (10.167.236.38) by MWHPR0601MB3610.namprd06.prod.outlook.com (10.167.236.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Tue, 18 Sep 2018 22:50:36 +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.017; Tue, 18 Sep 2018 22:50:36 +0000 From: Trent Piepho To: "linux-spi@vger.kernel.org" CC: Henry Gomersall , Geert Uytterhoeven , Kyle Roeschley , Mark Brown , Trent Piepho Subject: [PATCH 2/2] spi: spidev: Fix OF tree warning logic Thread-Topic: [PATCH 2/2] spi: spidev: Fix OF tree warning logic Thread-Index: AQHUT6IDJy3qOScL+0SCt5FROsRgxQ== Date: Tue, 18 Sep 2018 22:50:35 +0000 Message-ID: <20180918224525.28001-3-tpiepho@impinj.com> References: <20180918224525.28001-1-tpiepho@impinj.com> In-Reply-To: <20180918224525.28001-1-tpiepho@impinj.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: CY4PR22CA0071.namprd22.prod.outlook.com (2603:10b6:903:ae::33) To MWHPR0601MB3708.namprd06.prod.outlook.com (2603:10b6:301:7c::38) authentication-results: spf=none (sender IP is ) smtp.mailfrom=tpiepho@impinj.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [216.207.205.253] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR0601MB3610;6:SioZz230M+pyxO1SQUANcmoe9aJw+TszH4yXfkC9hydmqX0bsStNNABgKBQkm6IT+Fxo4U6DG7qs7dIOondOWkn8R7SI6hyrAZNQIRxAkgTK9d0JoL2x07sk02NVrAfPHaMY9Ad2W0hzRTGoL9SD/q1vnUCxecXlQ6QaCMN2qlsVmVRVW/EZhBb8Pkx6XKEoCjX68oiUFc8nxqnkX5vl6GzWARAYJADasocD0/pB/wVFmUQ/ww2vf+SMt+DthsmAJ73VRccx6+dav2SHeiTaKifkrXxKU1AZ5N8y75IHHkT4ZYwj0nlru5KpeZpVdeDjJ18OD8Y6XrUc5FIvGQnqOyjkyCOtLOzd/bGGfQxlFwAngTNJCUVDlM/3M2uWofRbYgpg+LEftOKvf70Gd2YIMaQh6R8FxQJaZd0ywbYn8OrLgwLNDocFmWP6iJ7FUZb6BuYV31QObBputaKNPJ5pqg==;5:JxrF6hJ70j6tsdhbIkoE0Kb83hxPXL1BR55GZOjalmbpuyGCQE3N6lhMimFnLxdCtU+aS6OpVkbFXQQlO8IRb+kKsi1NKRvmaAqoVo7vYuky9UUjEPs2Q4Y6d2sbgpg5u37cd9FxHKR6yZ8fHUW4lf42ykCyqufimIWzeHJY2+E=;7:6TZ5wlA7YrHUBb7clRlXbb2TFXY8LA7u2mfNRs+opj0QzP1Sh1vKdXg3fEucS1f4oAFkgvK35qPaVcueNy4enocabVgTIWMj82/KaeSbP3ombC784xjOIM73aFKW6wVlhXWis6QFvYUTm1n+SYM7YTdLNCIFnXG4S1nYvr2iIbOWD+GKyNTuJBy9JspncUSCTBiURGb10afMfRifgGB0pPIg546S3wzj6JF3l3FCuO+6Avvf2nsXpo7P81e9An7v x-ms-office365-filtering-correlation-id: 5bebe27e-70e3-4d71-f60c-08d61db92596 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:MWHPR0601MB3610; x-ms-traffictypediagnostic: MWHPR0601MB3610: 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)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699050);SRVR:MWHPR0601MB3610;BCL:0;PCL:0;RULEID:;SRVR:MWHPR0601MB3610; x-forefront-prvs: 0799B1B2D7 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(136003)(366004)(39850400004)(376002)(396003)(199004)(189003)(52116002)(305945005)(107886003)(2900100001)(25786009)(256004)(8936002)(7736002)(81166006)(81156014)(6486002)(5640700003)(6436002)(8676002)(316002)(6506007)(386003)(2906002)(5660300001)(6512007)(53936002)(86362001)(54906003)(68736007)(6116002)(3846002)(36756003)(1076002)(97736004)(2351001)(99286004)(66066001)(2501003)(102836004)(2616005)(476003)(11346002)(26005)(5250100002)(106356001)(4326008)(14454004)(6916009)(508600001)(486006)(446003)(105586002)(186003)(76176011);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR0601MB3610;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) x-microsoft-antispam-message-info: P5a6+ORlWcjhyuq+RDI3wz6fdVUDu3A1pAK/QOMwX3JuMS6KYcwmjbtjUkpSJJHgbiFMJstMbIrR1EKkVQSXnQWzC4gWdj/GkVbs8K9hF3RAfWbiHQwQUfzKFgWhZqV2zoBMChw8J4KZdeKqjWiMnOMZXlJ4R251Tzf/XE8PKnlHwEOAHVsN934BXq7G/h4NemoDNffl3nuD6RmWlDObAcF/T/YT/684zNY4Ijo4+XNrcERzUw25Etj9NNp5Xs5cA8dptN+CPf0HypR9+CWxezQeaPxkvk2kYVCQeTtMV3jRfnMOU50Me9qU65RuS4bY7qq9+wQZI76ZT16vegXGvWHf9A+SCIhNA6+sqhR6ma4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: impinj.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5bebe27e-70e3-4d71-f60c-08d61db92596 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2018 22:50:35.9221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 6de70f0f-7357-4529-a415-d8cbb7e93e5e X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0601MB3610 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: Geert Uytterhoeven --- drivers/spi/spidev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index cda10719d1d1..eee976f8c399 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -724,10 +724,11 @@ 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)) { + if (spi->dev.of_node && + of_device_is_compatible(spi->dev.of_node, "spidev")) { 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)); + of_device_is_compatible(spi->dev.of_node, "spidev")); } spidev_probe_acpi(spi);