Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp62205rdb; Tue, 19 Dec 2023 09:20:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHL0kcnVei0sOAs0858tya56Ufyc+T44HU/MyBWjw8J3D9qzjyELqKTWiDW+jVhr1/K6Qy7 X-Received: by 2002:a37:c403:0:b0:781:dcc:cef0 with SMTP id d3-20020a37c403000000b007810dcccef0mr227228qki.39.1703006402221; Tue, 19 Dec 2023 09:20:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703006402; cv=none; d=google.com; s=arc-20160816; b=aILHbN8c3KmEf1gFaRtTEv8kuLZTO34PUpKT4iIIQb/rVYpwz/Qu47naGZ65gyn3He nheO/XxdAYtsSCM0e5rghTEyr3JWgl6Bg5ii6zERTmwNjVS31ikLLaB/zN3EMUOdgrrq +qvba4yX28N5dJxesBjCeXW6ssD2/cF8y/O6rSZN7dgMgD5hV8qNENywS8LGthznkZZZ VKq8FC61YVZeqmaxEaNIImzJ8hQS2V9IMDm5MjchIwb39RZhRn+pTXn44zWJPxi+e+9j yjMWNW8e5MvcTejBzRtKjNsstTZB1vgGjKi7pcr98P974qpQqe+deGWSI/JExU51Zie8 lNFQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5665-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id pa23-20020a05620a831700b0077419b27787si25780265qkn.177.2023.12.19.09.20.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:20:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5665-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5665-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 9B13D1C24CDE for ; Tue, 19 Dec 2023 17:20:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8F3931A7F; Tue, 19 Dec 2023 17:19:32 +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 Content-Transfer-Encoding: 8bit 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) 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++) { -- 2.39.2