Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp299490rdh; Sat, 23 Sep 2023 10:50:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFeuxHRv0RM6XkShozu6jTVYe+Iu0F2ELgvsl0V/oX9ypR2w1cPR37Mm6S1tmlpXblmUNZW X-Received: by 2002:a05:6a21:4982:b0:13d:5b70:17da with SMTP id ax2-20020a056a21498200b0013d5b7017damr2040459pzc.26.1695491423387; Sat, 23 Sep 2023 10:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695491423; cv=none; d=google.com; s=arc-20160816; b=Xd48Fz0VYmkoC3lRe74WNPy0q1eoc7Xg7dtKKYFzBsxdJ1aEULoxH6uBvD3hIRoCUo XoKEoo/8/x3nH3cC7o/O2asD7UggQ6+pku8v0R86eAP228PsmoKi/4a/hRVaetw6SZGZ eYhaX2kCKK0pl5rwM/V23AsX0ieA0OwXz0im+16fCdHDT7Gkpp7NsAgtK3I73AP2gOVi fe7Xc01p/E1HjxxMzCTnhQxMZWX+7DTTgszusyxiOdWVpyQIjPReL/8a1mZ0ZSLOmb4d xS1cTCQpBDGh5tfzcOiHWydBb5OgUQtWPmdSh/5IrZuPx3+TypbUgOFxm1MbvMzqbC/f 8k6Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Jbmk+C5LHt/M21cyFQykBV0UWQhV4oIStAq5Cgf4DUo=; fh=I9Ehjxm498n/bZbFzcVJzYOYZVfj5ieX4tvCNWeI0l8=; b=hLdTeEJ1ztSCq4QCtXk52yPSIRZdmiSBJSZ+cgDJFeCTVpCiUAWoCu0G/lLb3+xxbV W33HEYDMRwK6+DO5Vh1VG0NpfLPKmKoCOAAza16U2jDyAHmH4p3BBFzUHYDN6EJwG5Jh nlJTPGVAs796PDy5FSxCMdVq16nX9++XDsaT3hlXzgK+mxgkN5Hubk2PgDnNFeS9dMK5 GxMRkclWvdd1rWc6xQ0pU0mdvQnzG4inCLEJ6nBn2+r/e5MH61sWa8+95fZjzcKrIWRN VULRkXqJQD4l0I1seDa+vd0t4yR7GoVuyKGov4ejWHFpW/biANfQPMbn4FqWQ6kfJP0y ZSbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q17-20020a17090311d100b001c36018fdaasi6661171plh.219.2023.09.23.10.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 10:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 98D008229F05; Sat, 23 Sep 2023 10:50:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232194AbjIWRt4 (ORCPT + 99 others); Sat, 23 Sep 2023 13:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbjIWRtq (ORCPT ); Sat, 23 Sep 2023 13:49:46 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 503F7127 for ; Sat, 23 Sep 2023 10:49:40 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.03,171,1694703600"; d="scan'208";a="176997671" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 24 Sep 2023 02:49:40 +0900 Received: from localhost.localdomain (unknown [10.226.92.12]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 33C794005B3D; Sun, 24 Sep 2023 02:49:36 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , Charles Keepax , Richard Fitzgerald , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v4 2/4] mfd: madera-i2c: Simplify obtaining I2C match data Date: Sat, 23 Sep 2023 18:49:26 +0100 Message-Id: <20230923174928.56824-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230923174928.56824-1-biju.das.jz@bp.renesas.com> References: <20230923174928.56824-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 23 Sep 2023 10:50:20 -0700 (PDT) X-Spam-Level: ** Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Acked-by: Charles Keepax --- Note: This patch is only compile tested. v3->v4: * Updated commit header. v2->v3: * Used uintptr_t for enum casting. v1->v2: * Added Ack tag from Charles Keepax. * Dropped blank line before switch statement. --- drivers/mfd/madera-i2c.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/madera-i2c.c b/drivers/mfd/madera-i2c.c index a404ea26bc79..0986e4a99f4a 100644 --- a/drivers/mfd/madera-i2c.c +++ b/drivers/mfd/madera-i2c.c @@ -18,21 +18,14 @@ static int madera_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); struct madera *madera; const struct regmap_config *regmap_16bit_config = NULL; const struct regmap_config *regmap_32bit_config = NULL; - const void *of_data; unsigned long type; const char *name; int ret; - of_data = of_device_get_match_data(&i2c->dev); - if (of_data) - type = (unsigned long)of_data; - else - type = id->driver_data; - + type = (uintptr_t)i2c_get_match_data(i2c); switch (type) { case CS47L15: if (IS_ENABLED(CONFIG_MFD_CS47L15)) { -- 2.25.1