Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp34935pja; Fri, 22 Nov 2019 03:06:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyR+gR4wxsHbehXjOzwmKdKvb5efIqoX5uaKVHjlbbv8q4o2HNh/qLGCIYrGzjqQk2goNVA X-Received: by 2002:a50:ce48:: with SMTP id k8mr319984edj.6.1574420814487; Fri, 22 Nov 2019 03:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574420814; cv=none; d=google.com; s=arc-20160816; b=exXuAfJkZBv61Uby93T8qH7h99cq7kAC5O4kCLrpbH0y9uGRY4co0wut0AzhwYVDVQ FpkgFWKHTlJ2IgeEQoa96NRCEjXKJEWyUMeGWyT2j58QSE4J0oUkOnh1tX/O1Tp2QCwH fXiXb21e7qQ8P+rTqX+u35bRHGCk4bXyLQmeiVRuiR3fl5RBjkyUCN0G974wsSw9vXCC hkQzoAJi7bsaDyY1XrgKKiP457H6rphGnWHxmfqxGqzBsLUsijozcjDOwOzqRIhIByT8 zCmTIZ3LnzCgjOhakD8Hyr/Oaj2AerJe8Yf1cjhCaQEZQfWWsFnUAB3KwSqbd+lkknmF ZWvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T7tB6w9kT+6DNSDvABbtnVTBGnO/dOS1zGwEuHAcy7s=; b=BO4e6g9GQ8hmcOis/dWvfZRM595ZNkPRWVUDoyEe/DVEvEC/KODnvB2Av3Vjp8wvdG SqmyuvswMFYQMHK2XjlA6y5RY7KOktLVmDrBF0GhhWCP0VF/XMr7HwP++YvnAMaNYVLp UZA6dzPiEr4fHhhnYXqTSWulvB47p228FYNXjAN9oNYgJIAyHJQHkdOK1l/z8582MJMX A5e5gm36c36eSndVhCmtiqjSsQ2ijLxrdH1vrEnoYDptbsfuYbgS0B4+GW813XgvblX3 lasq6Cof/X3Jz4kRoZ7B9k+cYY3odbB6JyDK6t0O22pM3m/fUQS227t0RHf3xYtiT7DQ 4YzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CgGkjHUC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si4353039edx.113.2019.11.22.03.06.30; Fri, 22 Nov 2019 03:06:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CgGkjHUC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731624AbfKVLEy (ORCPT + 99 others); Fri, 22 Nov 2019 06:04:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:60146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731108AbfKVLEv (ORCPT ); Fri, 22 Nov 2019 06:04:51 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A90E720854; Fri, 22 Nov 2019 11:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420691; bh=ZhaejBiZlZmk0+HgH9Jh1GY+ficYYpHrDSmFxd6848E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CgGkjHUCJB92/1HmRrxHsHsyG2AclTnPvycLNoHWHDPEY6TlHF2jJjO2GvMKy/Rt5 rzFi7mKbDQjCBxkQFv/uX9tXV/nUEHhX+LWROAK3MHYjj5IPVjrrm2N665TYIKdTmn NhB4Fgt/9ewx6gD8HVd22QqX6V6t9WodKYMp5yMI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trent Piepho , =?UTF-8?q?Jan=20Kundr=C3=83=C2=A1t?= , Geert Uytterhoeven , Mark Brown , Sasha Levin Subject: [PATCH 4.19 193/220] spi: spidev: Fix OF tree warning logic Date: Fri, 22 Nov 2019 11:29:18 +0100 Message-Id: <20191122100927.947018059@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trent Piepho [ Upstream commit 605b3bec73cbd74b4ac937b580cd0b47d1300484 ] 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 Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 cda10719d1d1b..c5fe08bc34a0a 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); -- 2.20.1