Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp425014rdb; Sat, 2 Sep 2023 15:53:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGRYvsMHtFleV7yEM8r3Qd13K6+60ucbQgpACc47K/1KDrpDPGXirMIWfaLsmJhxibzivjr X-Received: by 2002:a05:6870:c0ca:b0:1bf:7e94:bba9 with SMTP id e10-20020a056870c0ca00b001bf7e94bba9mr7630138oad.52.1693695229198; Sat, 02 Sep 2023 15:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693695229; cv=none; d=google.com; s=arc-20160816; b=ELxtrjAYb4u2G+ECaj9KJ977bparXeH/CwxwcUxKYQEe3HzNDIXzfmcMCwJTL5EqjX 4AmZuDXW65sN0Gc6sIdVJFMn68ZAwSxbkKZsxhQ4hg5MXKc/b2uDx/5enQmiZ8EA886r ku2bSgJZw6t0rqGT5wvZUfUsSNa13PzIweLuH8w1D/zl0gGJxfOgioNWasGpAHV1KFpZ t6aU3xVK0yQDroLXa226iO58dwa7U8onqr7/DjQPpoQ+7FJJ0Nr4qiT0yEJHy61kffmS kav/RpKQ5JerElqXON60Q7BugNvZJOdBoBG1eszFQFXT7qqSS6+H3OAaD9IFEyaYt/e3 078w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rIbD38T1U65wxmgn2c8Elm9SZRPy4JyyBzAMpSiYn8w=; fh=XM9OH0pro9XzaZqbNisgZpk8XzAMHkZiN+oPeqnvN1s=; b=tS8enStn5rWGe1VyTCn/k7I21/vHLnyR8aWtKGqhlayLyiTCJOxnOoepIvtG64O2o3 TZVhUZu7vW7s+ga4SWWsiLXjYZe2VNwk8eKun2Zr3iqUMPg9cLI0fKk4BM9vq/3Dd0+P DEA9T+W1+s61SoFZdsD5hrXM2v0FjpAXsCXt4k3PXSR5prdsGD8pXQWtumD35QG1VZpP wUYvWaXab2GvOTeeCldG77Ybch2K+ys3I4km3RkTst0WNTOBEUKSEqOAK+Z6lTxpRlRt YGrgQ7a5cqY6zcXC5AGYWmq4s9Zjbu3IswjaxyGL+3tgHpLul7K9vm+1dJoz2ii+iFZe 6rSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170902a3cd00b001c32d285db9si990036plb.194.2023.09.02.15.53.34; Sat, 02 Sep 2023 15:53:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230212AbjIBRp7 (ORCPT + 99 others); Sat, 2 Sep 2023 13:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230206AbjIBRp6 (ORCPT ); Sat, 2 Sep 2023 13:45:58 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BE39DB6; Sat, 2 Sep 2023 10:45:53 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,222,1688396400"; d="scan'208";a="178508459" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 03 Sep 2023 02:45:52 +0900 Received: from localhost.localdomain (unknown [10.226.92.16]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 41243403C476; Sun, 3 Sep 2023 02:45:49 +0900 (JST) From: Biju Das To: Bartosz Golaszewski Cc: Biju Das , Arnd Bergmann , Greg Kroah-Hartman , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH] eeprom: at24: Drop at24_get_chip_data() Date: Sat, 2 Sep 2023 18:45:47 +0100 Message-Id: <20230902174547.71316-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace at24_get_chip_data()->i2c_get_match_data() as it is redundant. Signed-off-by: Biju Das --- drivers/misc/eeprom/at24.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index dbbf7db4ff2f..af83aca452b7 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -509,32 +509,6 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count) return 0; } -static const struct at24_chip_data *at24_get_chip_data(struct device *dev) -{ - struct device_node *of_node = dev->of_node; - const struct at24_chip_data *cdata; - const struct i2c_device_id *id; - - id = i2c_match_id(at24_ids, to_i2c_client(dev)); - - /* - * The I2C core allows OF nodes compatibles to match against the - * I2C device ID table as a fallback, so check not only if an OF - * node is present but also if it matches an OF device ID entry. - */ - if (of_node && of_match_device(at24_of_match, dev)) - cdata = of_device_get_match_data(dev); - else if (id) - cdata = (void *)id->driver_data; - else - cdata = acpi_device_get_match_data(dev); - - if (!cdata) - return ERR_PTR(-ENODEV); - - return cdata; -} - static int at24_make_dummy_client(struct at24_data *at24, unsigned int index, struct i2c_client *base_client, struct regmap_config *regmap_config) @@ -601,9 +575,9 @@ static int at24_probe(struct i2c_client *client) i2c_fn_block = i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_I2C_BLOCK); - cdata = at24_get_chip_data(dev); - if (IS_ERR(cdata)) - return PTR_ERR(cdata); + cdata = i2c_get_match_data(client); + if (!cdata) + return -ENODEV; err = device_property_read_u32(dev, "pagesize", &page_size); if (err) -- 2.25.1