Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp423724rdb; Thu, 31 Aug 2023 13:31:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVr2V4KJEfjVwo+DIgcjYRBVy/5e1YbR3McL3o5miCL+a7XJFq4ojZI2F8o+bMmjjrvoQN X-Received: by 2002:a17:90a:318a:b0:269:55a2:952c with SMTP id j10-20020a17090a318a00b0026955a2952cmr409873pjb.40.1693513895067; Thu, 31 Aug 2023 13:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693513895; cv=none; d=google.com; s=arc-20160816; b=JAdrYJ1lMMJ3KvqMekkZ1an5I9ko8XNjcxjlugvMb/6Qs/cVNZcTLKpPefy3FcFawk H6eq6DzAMkwX4WF+inigWoLqYa6dQy3MnxlN3uSZJ0ikg+M+RfuBUNoEkBkw1bV41Ed8 AUBdtbkfjRIZItfzQzEk1tQ87Vji/rGbcu8SVGAAs/HHEqLzAnL0UuP7rQhLX8Lky9/2 W0URA41wMxhMgkE0qvYxDhQFzq2V6Yl9zHKrIW0sQOzmsL+ZDfVH124rhQRW9ZI7kOp9 7NojJxI1LINnUT3EgNxzcB7g7PeUMK6MMgy70ygKSyQVL4Gv+KNr9ulmqSpyE9s0wRY9 EsHQ== 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=6lFGF8drbeL4DmZZhR9ELmZDOcNtQ1FOlDpWD4lagW4=; fh=uHUQMY3ScCCKFoIkA2KaGBsmege9T5JuhXIcbF/hmCs=; b=jW03QsL9U6it31uhpMuokohLQOdyKb9v8whAzZ/dARg/Q5Bd8kL0OoHpjQAmIwN1ww bAh/iivrdJ8JFEkr6oUgDkCbLkYWwrLA5msUTCyPxDnEF3u6aNMijQiSFjW4d10TPhXF GP+1Xb9T4IqOFb+ErfOe7Tt6JTuVG515Qj3Ir7n0vSZogzUbK2bxTO2lKEg59MMoGRAB 7lVNqSeKkIURfFMNE4PNbzNcw2qLmFZhvnZDDf7uqmSVT+izZfk4r9q002E3/8ebgpPk ZPtbSMsK85IdV40qbqZEr342LoD8BJeFEe0q9rjzIVIXr4yP3LbmlMF8QtH8vaRHE2dC jfSg== 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 o5-20020a17090ad20500b002691e659560si4278951pju.163.2023.08.31.13.31.08; Thu, 31 Aug 2023 13:31:35 -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 S1345287AbjHaSxh (ORCPT + 99 others); Thu, 31 Aug 2023 14:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344824AbjHaSxh (ORCPT ); Thu, 31 Aug 2023 14:53:37 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 977CBE66 for ; Thu, 31 Aug 2023 11:53:33 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628969" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:53:33 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 97BAE4097B07; Fri, 1 Sep 2023 03:53:31 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3] mfd: max77541: Simplify probe() Date: Thu, 31 Aug 2023 19:53:29 +0100 Message-Id: <20230831185329.70472-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 Simplify probe() by replacing device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das --- v2->v3: * Restored OF table. v1->v2: * Restored error code -EINVAL. --- drivers/mfd/max77541.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/max77541.c b/drivers/mfd/max77541.c index 10c2e274b4af..d77c31c86e43 100644 --- a/drivers/mfd/max77541.c +++ b/drivers/mfd/max77541.c @@ -162,7 +162,6 @@ static int max77541_pmic_setup(struct device *dev) static int max77541_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); struct device *dev = &client->dev; struct max77541 *max77541; @@ -173,10 +172,7 @@ static int max77541_probe(struct i2c_client *client) i2c_set_clientdata(client, max77541); max77541->i2c = client; - max77541->id = (uintptr_t)device_get_match_data(dev); - if (!max77541->id) - max77541->id = (enum max7754x_ids)id->driver_data; - + max77541->id = (uintptr_t)i2c_get_match_data(client); if (!max77541->id) return -EINVAL; -- 2.25.1