From patchwork Tue Dec 19 17:18:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 181137 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2094971dyi; Tue, 19 Dec 2023 09:23:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxPHpoSV38CuFZcmfQm8QbbXvid3nVmTre56oYMdt8hEgfo4QrmEj9Xn0R3GRWPb6KkoIW X-Received: by 2002:a50:8a83:0:b0:553:456e:b609 with SMTP id j3-20020a508a83000000b00553456eb609mr2654277edj.13.1703006609701; Tue, 19 Dec 2023 09:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703006609; cv=none; d=google.com; s=arc-20160816; b=hi537e7pCK/OAsH+EnwUWbxLTJzLNGD9HwNb7ztpeUMGWvJ76huTgVJqci8TiHKfV4 AwslI6MR3Rg6L8cOPK0XMTzIV3WPuDeFtXl7Vw7uSs3riJpqNdTJTOtnDHy4YYLUyZjK M4yRXYZUr5wwECOCMkJOUI8RFXy4AvsIAcVliQgzDS6eoufn7vJAvsqbGkL3daruWqbs iDyWgnK4g2CHWItDiQb8NnGUVQ/iyiYaI2lEc9793+93r4KouODRqY00yWC6B5w8q00S nrx39iTAjll4GFTlWTOfDBz/SLlfyIeer1hoWA3Q6RHgM/jYWSabqtMJ5O1L+AFYUFF7 qnfw== 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=wpxONzVdPDOBmeZf3AvhDTOhsPLl8o7m9pBKKhTUjcU=; fh=XmY8az1z5a+LjrZQ1DQahIeB3Uro2SuOHb+6mIYcxXo=; b=b2dqq1q6EXWmoLCohz8//oeJwJ62sY07FCDR/4gUpj/JUCbEYC0oWubkuEubHA4ziI scY2B8TeNCyWaOUAfRzLZOumn/KjxA6x54nXaH6GXW3Z0/UH/np3FbNXMoI0O/Zq83gf i2phqSHkQqGRsMPohzKsP+bA5Re1fi9MDavIn6oETr7aMYJEzn5Cv2AME7U+MMMJ2xgk Gm1BeQJfx7CpRSiHpZ/SA1Km6o9L2h+V/svr8MLDw9mBffm72VrMMsJleLcL3cVRn+HC wXDJ6kW9O3ZLqwysKJVUo3N9pO8KAUohZfG84tlOq3Cm26c7K6dX5WGFmL5y0fOR1lWD puzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b="So/GFKJp"; spf=pass (google.com: domain of linux-kernel+bounces-5675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5675-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 r19-20020a05640251d300b005523ad0a3c6si5695655edd.468.2023.12.19.09.23.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:23:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5675-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="So/GFKJp"; spf=pass (google.com: domain of linux-kernel+bounces-5675-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5675-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 3CC4B1F23119 for ; Tue, 19 Dec 2023 17:23:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4960C35282; Tue, 19 Dec 2023 17:19:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="So/GFKJp" 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 D1CE337178; Tue, 19 Dec 2023 17:19:28 +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=wpxONzVdPDOBmeZf3AvhDTOhsPLl8o7m9pBKKhTUjcU=; b=So/GFKJprQ3l/iO+UzDe0ddOtI DlyMEhRL+z38g6fjAfX+No4dwSQ6iPQTBJydcy8Co3pBx5BxpU/iK86h6SKDrdTUnBKfjuV3cPss1 UbZQErZihBwTW6m69yTCXpQ7Z9QVkC/S6d9EE6ZgAySbKcGk2BgcWCT1+IegB79AmseY=; 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 1rFdkP-0007Ao-P9; Tue, 19 Dec 2023 12:19:14 -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:51 -0500 Message-Id: <20231219171903.3530985-8-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 07/18] 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: 1785731858818105547 X-GMAIL-MSGID: 1785731858818105547 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, 4 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 8cbf54d0a16c..97a97a4bd71a 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1798,17 +1798,14 @@ 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 = (struct sc16is7xx_devtype *)i2c_get_match_data(i2c); + if (!devtype) { + dev_err(&i2c->dev, "Failed to match device\n"); + return -ENODEV; } for (i = 0; i < devtype->nr_uart; i++) {