From patchwork Thu Dec 21 23:18:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 182476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp743399dyi; Thu, 21 Dec 2023 15:21:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEt8npiIBW2TrylBqxwSlRZZSuSCxW0PD1cz9H9IirmXhqKsNcWfevSt+s610t+gql2xIiY X-Received: by 2002:a17:907:9047:b0:a23:63cd:6587 with SMTP id az7-20020a170907904700b00a2363cd6587mr222185ejc.92.1703200913026; Thu, 21 Dec 2023 15:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703200913; cv=none; d=google.com; s=arc-20160816; b=M60EEOwbj0dIw0d8QIU/vupV1VQUKykUeU0RaiPcVYjqhs8WYaetcZbT53xEVVvyrp hwzGxQegldI6Xuct4Go3O5wWQoRfT5CalPNSFeWKbx4iUb2DpOqL5uhrnIT5UEIT+qL9 sc8qPYoQG3CWkcv3f+aHmWg+JFHY3/0Ck/vZCKtNhHfWrVZonmzmzYn7GrSyt/DAAEAD NskeZJa9ZTejMFHCeyqpTsvnUKC+ME28lGJq23oLn1GtMXhq04tZKFY/iSJzYAkejdW/ OX4IWgtHdmgI8LczEvL1w9eE8v7/35vgTAUG8vrfAHZ2RBIFpEbxkuMjhbod3c7j8SHN AdpA== 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=1D+dxnnl4V5IiyIxDqSn6oylZMa3p3hHDTTttZBVpxA=; fh=xLWyschydcwW23fRlVvCnAn0jM2rGvhMoJ71MHWBla4=; b=wym9PvKj9O4G7UYCgxPijnLLHAaO5TwNPp2aUZ8njPZpddVGVgOnFjC4YzA1QaCxdf pJZ3dB1H/bJ0rzXxxQ0s12w2gyoFktruBwojnDoAmpHg+M2vUrmNP1K1uF2oJXkpt14O b6VQvwOqgUhc9z+DdHjgW9d7fVQ7zk1e2fKHvr6WbVidP7bkkcB3xpHugwIfzdBFMmr4 5vLL0DCVFM7oT44I/hveefNAAapfhU49pUBgKLmKPdjBVXc0RKDW22fIFuIai7O2P6gP qD9hYgQNhsY+yAhWoodnmi296p6XZZGNKs0H6rKIxrUcm/WY3AJE63aEZ8yPOlcpEktA Hu1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=MVQQxVsu; spf=pass (google.com: domain of linux-kernel+bounces-9164-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9164-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 gi34-20020a1709070ca200b00a1d3eccb0f0si1169295ejc.428.2023.12.21.15.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 15:21:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9164-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=MVQQxVsu; spf=pass (google.com: domain of linux-kernel+bounces-9164-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9164-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 A145E1F22387 for ; Thu, 21 Dec 2023 23:21:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C0B37D5EC; Thu, 21 Dec 2023 23:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="MVQQxVsu" 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 98D0F7996B; Thu, 21 Dec 2023 23:18:51 +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=1D+dxnnl4V5IiyIxDqSn6oylZMa3p3hHDTTttZBVpxA=; b=MVQQxVsuzFn032/hFu/ov74Tzo VH9rvd/gFqcq2AttJTmrumHZIPspMr5p4GikMwwRdIQ+elrPS5lQ6GAO3zFO7fZh1pwZBQyKlbby5 2zvff891t9QTScC+HBqe/mWHcvJMzrlA1ciI4cr3aKLZE3HyuvQGKheio/06TjxHy/UY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:52484 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rGSJM-00025W-Ls; Thu, 21 Dec 2023 18:18:40 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, kubakici@wp.pl, indrakanti_ram@hotmail.com, phil@raspberrypi.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, Hugo Villeneuve , Andy Shevchenko Date: Thu, 21 Dec 2023 18:18:14 -0500 Message-Id: <20231221231823.2327894-8-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231221231823.2327894-1-hugo@hugovil.com> References: <20231221231823.2327894-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 v2 07/16] 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: 1785935600757184975 X-GMAIL-MSGID: 1785935600757184975 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, 3 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 42e1b4c70ed6..4161d692df40 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1742,15 +1742,9 @@ 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 = spi_get_device_match_data(spi); + if (!devtype) + return dev_err_probe(&spi->dev, -ENODEV, "Failed to match device\n"); for (i = 0; i < devtype->nr_uart; i++) { regcfg.name = sc16is7xx_regmap_name(i);