From patchwork Tue Dec 19 17:18:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 181131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2094543dyi; Tue, 19 Dec 2023 09:22:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9XhjfsvC30X/Hs7cQf6f1fT9iEj4cGXIJHi3fLa6BtgFEu1uM0tc1TcbVW+2SAL4u2bSF X-Received: by 2002:a05:600c:2259:b0:40c:1e66:4dd5 with SMTP id a25-20020a05600c225900b0040c1e664dd5mr9051253wmm.216.1703006565566; Tue, 19 Dec 2023 09:22:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703006565; cv=none; d=google.com; s=arc-20160816; b=lRpmgJBIv93v1Ugyuo0IIMTMmlAxkmJGYfazcIu6EK/wJ88zbIJG6hOMoNFzEYAR34 EfANH0PLZBjIrDYp9JdjWw1yfln4weaVItZ3Y8y4r2qOqEqsk39hejRuGIekE4lVwKRk /KzjPnJrVq7JRnb5aOHUQ9dM9w+zWE5Itu3ZgVay0pk3XgJzpwce7m6iIYrD0rX6mJpV fQ0dAxxlDfU/PN+e7cgkKYp+bZN1PJN0bZ4aS56lpQHe6KmfXdv7Mip54JIinkdJwfpz 2C/T51tpKHcXjAEukEwjAVtQj6Pe3Xc6BUQK3oOnsVUQutg19FeVyscJ6xOICVSQLCV2 DVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:cc:to:from:dkim-signature; bh=xfb6kuDgKADdMzZzBWchLLnlFd6E5qjoWxtuwWK9Sxk=; fh=XmY8az1z5a+LjrZQ1DQahIeB3Uro2SuOHb+6mIYcxXo=; b=FKYQhN1TgbrZViWv9SKuNQA2BsPD37GeUIVMbJCYTHA9h1xHSzt80uGW/5OinsjRcX 8zb0OvhDh6G4WbbmhzmeUnnPZRBBjsSfic+wJalHrIqP+0fayOFVg0Ei6WtI/tl16Cxw wMXvfU2ZScRQ5lJors7KL0Ej0gHouQSygJdZU04HGkU0GJBWe5VWB+taLwuKLdAzHtUa faNPryS+P53yNH8RTxEKyiZTttp8u8lU7lWHT2WYFdpc3Dyf1a6iBm8rj8hIXCs6UZZN WpH2x6UkRrS+YYtbuN2gUraji+IHSgLw0cgXeXfrYS3U9WQZmjmizIokb+3DNu6xpfXo dMCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=bfismZTE; spf=pass (google.com: domain of linux-kernel+bounces-5665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5665-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k7-20020a170906054700b00a23674648d6si1278014eja.815.2023.12.19.09.22.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:22:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=bfismZTE; spf=pass (google.com: domain of linux-kernel+bounces-5665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5665-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5F96C1F2631C for ; Tue, 19 Dec 2023 17:22:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A41639ACD; Tue, 19 Dec 2023 17:19:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="bfismZTE" X-Original-To: linux-kernel@vger.kernel.org Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E278436AF7; Tue, 19 Dec 2023 17:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=xfb6kuDgKADdMzZzBWchLLnlFd6E5qjoWxtuwWK9Sxk=; b=bfismZTEkWG4Ih0UN0v1U5iSdR I6D5TQ4LYGpXeirp/GWIg4PAY9wNRxLtQFySR17aQnh5kq0s3PEU6SPugupj1/OOWiIxK6vc9jL6x N7J+/+kIKSEiaAfzEU0YeWn/wnoW9Tkl+ByzXzZ4ly0YLpiZTH93ol6SPz4yhi34Zuoo=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:40128 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rFdkO-0007Ao-PK; Tue, 19 Dec 2023 12:19:13 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, jringle@gridpoint.com, kubakici@wp.pl, phil@raspberrypi.org, bo.svangard@embeddedart.se Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, Hugo Villeneuve , Andy Shevchenko Date: Tue, 19 Dec 2023 12:18:50 -0500 Message-Id: <20231219171903.3530985-7-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231219171903.3530985-1-hugo@hugovil.com> References: <20231219171903.3530985-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_SCC_BODY_TEXT_LINE No description available. Subject: [PATCH 06/18] serial: sc16is7xx: use spi_get_device_match_data() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785731812572102810 X-GMAIL-MSGID: 1785731812572102810 From: Hugo Villeneuve Use preferred spi_get_device_match_data() instead of device_get_match_data() and spi_get_device_id() to get the driver match data. Suggested-by: Andy Shevchenko Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 597280a5d0f3..8cbf54d0a16c 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1742,14 +1742,10 @@ static int sc16is7xx_spi_probe(struct spi_device *spi) if (ret) return ret; - if (spi->dev.of_node) { - devtype = device_get_match_data(&spi->dev); - if (!devtype) - return -ENODEV; - } else { - const struct spi_device_id *id_entry = spi_get_device_id(spi); - - devtype = (struct sc16is7xx_devtype *)id_entry->driver_data; + devtype = (struct sc16is7xx_devtype *)spi_get_device_match_data(spi); + if (!devtype) { + dev_err(&spi->dev, "Failed to match device\n"); + return -ENODEV; } for (i = 0; i < devtype->nr_uart; i++) {