From patchwork Tue Feb 21 13:33:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13147951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C75CFC6379F for ; Tue, 21 Feb 2023 13:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234033AbjBUNcm (ORCPT ); Tue, 21 Feb 2023 08:32:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234062AbjBUNck (ORCPT ); Tue, 21 Feb 2023 08:32:40 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6802F29166; Tue, 21 Feb 2023 05:32:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676986352; x=1708522352; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CbTLdq9gpOZ1tlC0WjzeLsvTuFT+CtH0G4OwvkjX+2Q=; b=n3dEja3/d/nTs3FAheMIwcGJLxSZ8WKclHqxUC2QaKrXNuBAHh9lBuvD RYsEOJ3GdGEeYKWBsmR+qSckzRmVYfOwKZ01v5thGWRIYWZoSwA1cUkOs l7VJ6w3hovcJZ7ef6dh2424AwCkDf4iRqJUxWDzN3bIGzEEQ+k8DYn8W1 lB8bGeC5TkHHI5q7C3BxakQQEQzU2KC0DpHVxuQlX1VUfq97YGJ7JJDWb P0++L1qL06vCNf7lWV6sqLPljdXcfSGRMTjOuUjCInWxASNTALMSWSwh6 W3sAfLGhrJBwm5gnvHSQ0A+FkTHurLB8P0eVVRoYuBrlAAtTcyC8EzFUD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="333990931" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="333990931" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2023 05:32:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="649178421" X-IronPort-AV: E=Sophos;i="5.97,315,1669104000"; d="scan'208";a="649178421" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 21 Feb 2023 05:32:28 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id D7F3014F; Tue, 21 Feb 2023 15:33:09 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , "Russell King (Oracle)" , Raul E Rangel , Wolfram Sang , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-usb@vger.kernel.org Cc: Robin van der Gracht , Miguel Ojeda , Heikki Krogerus , Greg Kroah-Hartman Subject: [PATCH v1 1/3] usb: typec: stusb160x: Make use of device_get_match_data() Date: Tue, 21 Feb 2023 15:33:05 +0200 Message-Id: <20230221133307.20287-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221133307.20287-1-andriy.shevchenko@linux.intel.com> References: <20230221133307.20287-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Switching to use device_get_match_data() helps getting of i2c_of_match_device() API. Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus --- drivers/usb/typec/stusb160x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c index 494b371151e0..70d9f68d99c9 100644 --- a/drivers/usb/typec/stusb160x.c +++ b/drivers/usb/typec/stusb160x.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -633,9 +634,8 @@ MODULE_DEVICE_TABLE(of, stusb160x_of_match); static int stusb160x_probe(struct i2c_client *client) { + const struct regmap_config *regmap_config; struct stusb160x *chip; - const struct of_device_id *match; - struct regmap_config *regmap_config; struct fwnode_handle *fwnode; int ret; @@ -645,8 +645,8 @@ static int stusb160x_probe(struct i2c_client *client) i2c_set_clientdata(client, chip); - match = i2c_of_match_device(stusb160x_of_match, client); - regmap_config = (struct regmap_config *)match->data; + regmap_config = device_get_match_data(&client->dev); + chip->regmap = devm_regmap_init_i2c(client, regmap_config); if (IS_ERR(chip->regmap)) { ret = PTR_ERR(chip->regmap);