From patchwork Thu Dec 21 23:18:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 182480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp743568dyi; Thu, 21 Dec 2023 15:22:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJubP4ZHlQYxwVzyCoLTI/Y40gXgFHUiZmOE/kfc7OrSz2jNaAoNSZzUK5KX+yzGoYarSk X-Received: by 2002:a17:907:c99b:b0:a23:2eae:b879 with SMTP id uj27-20020a170907c99b00b00a232eaeb879mr221104ejc.148.1703200938415; Thu, 21 Dec 2023 15:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703200938; cv=none; d=google.com; s=arc-20160816; b=Zq7mzTZbl0rLZRr4tXBwRChoc/oPwVE0zdQzoxyHSwgEIeS0gyWcXvIe//fp0uWBWY DpKDbzWn4jQjJLsN/j5d9XnWFT6z1kodBiv3Aruztp7/Ya+Msc+/Jv52L2zza+9cXmAa jgPteLF/UAEOmn6/qZKz9p+c1xBnEAFs8e2+jQynR+QanCDwGB7KVhTJfk4StM9Pmte8 bwUOVatNy65LtI/oNyQhArW7bfCCH09efWO4Gk2ktIQ674qUttitcbfoqhqkzPpVX5Ut 0KSubPD/9kMSibO4EgdVgI1HwyGu9bhlCyjA/0lr0Oo24lbMWcNhXqD9TOF7O7zz9iQv F4Iw== 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=7TEnK/Z3hipz1x5knONUiV1aCkjkJZlxI+yRt9HAk+M=; fh=xLWyschydcwW23fRlVvCnAn0jM2rGvhMoJ71MHWBla4=; b=O65k1der1vHYBFjInXroVOARCt4qeq7aeuEJdqXMXfjf7rw3buHvUdhZyMrZKCopco HYNLBmsrSthieL6QRI8tpHHX+zCozAm0o4fY3zBoBpQh7O2ca9lcMxjTVLK6bk4ZJAtM i4NCwmfcIOI/k6v8B0hnLyKBGrbFjQb5Xs/+wkdBqlSQMcdlCTNfZgzSKREzoz8fVU2o alTyciSN5h6AKLuasyvWRHrG89+5G6ZCjrRbLypp/IB1Gj+Npw32TFxk0z/EbQdahIek T3Jcnm/rDqLCJ7REWg7ShdEJ8t+mE11Kn0DhWUh6fn07thxmBkn2TOTob1hevDJJsqoq 1iLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=b5KtzAvH; spf=pass (google.com: domain of linux-kernel+bounces-9168-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9168-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 ks15-20020a170906f84f00b00a234b6c0e0fsi1237770ejb.746.2023.12.21.15.22.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 15:22:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9168-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=b5KtzAvH; spf=pass (google.com: domain of linux-kernel+bounces-9168-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9168-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 0E9A11F216C6 for ; Thu, 21 Dec 2023 23:22:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B1797D890; Thu, 21 Dec 2023 23:18:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="b5KtzAvH" 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 9A4C27996C; 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=7TEnK/Z3hipz1x5knONUiV1aCkjkJZlxI+yRt9HAk+M=; b=b5KtzAvHWX5YwMloHiaXHDRnXP E1o52bGKL1LzovEuj8jU5Fm7mwgahKglKYZIt+fKS5RjlAdWDPLPG2t7x/jKJYW14tJvc0tCT8Goe 7M+cT/IU6gxWnwnIdVnMbaCmJR7r1PPbt2DSd7mRukybxGzLEUNLyPNC3XRSKD1d9Fqw=; 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 1rGSJN-00025W-LT; Thu, 21 Dec 2023 18:18:42 -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:15 -0500 Message-Id: <20231221231823.2327894-9-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 08/16] serial: sc16is7xx: use i2c_get_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: 1785935626830352167 X-GMAIL-MSGID: 1785935626830352167 From: Hugo Villeneuve Use preferred i2c_get_match_data() instead of device_get_match_data() and i2c_client_get_device_id() to get the driver match data. Suggested-by: Andy Shevchenko Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 4161d692df40..e7f3184a70a1 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1796,18 +1796,13 @@ MODULE_ALIAS("spi:sc16is7xx"); #ifdef CONFIG_SERIAL_SC16IS7XX_I2C static int sc16is7xx_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); const struct sc16is7xx_devtype *devtype; struct regmap *regmaps[2]; unsigned int i; - if (i2c->dev.of_node) { - devtype = device_get_match_data(&i2c->dev); - if (!devtype) - return -ENODEV; - } else { - devtype = (struct sc16is7xx_devtype *)id->driver_data; - } + devtype = i2c_get_match_data(i2c); + if (!devtype) + return dev_err_probe(&i2c->dev, -ENODEV, "Failed to match device\n"); for (i = 0; i < devtype->nr_uart; i++) { regcfg.name = sc16is7xx_regmap_name(i);