From patchwork Mon Dec 4 22:05:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 173574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3066524vqy; Mon, 4 Dec 2023 14:05:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGok3TE0m+62Dh/8AfiD03SyQYx4bBp8SN1ZGgUiGo9QP1CLPSPuMEaAflkQ5IuihMxErs X-Received: by 2002:a17:902:dac4:b0:1cf:d7e2:5e73 with SMTP id q4-20020a170902dac400b001cfd7e25e73mr2863996plx.49.1701727558510; Mon, 04 Dec 2023 14:05:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701727558; cv=none; d=google.com; s=arc-20160816; b=y7dQaQX7k7cu/k3VPqlgDt8JfpZo23o99dv/1yDyYDz3fYfcWV8vuYYfawxrQKoQAb 7RJ0OjsNUIsZy9MDLd8BuT6kE+xPiq1OTfnKEGBpv7apmjnWYyAWmzmTUnNChI1irHtd 8JYlFROH+30++Zu74xjvHhafn7cYz5Gk9VeEFnSFfWr8Ob6oCDuvmfOCPgyrve5jRch0 io/jxFNDAjdx6uU/HuORAAnIJ7HMlr0dXt/FfZiOrW+i4mMo9kRGD0EAlvSniNOQvGbE YibjAoiwYPqhvIzpNS+Xx2KncbwuyvkUr1W1ofCVAzESH4o7lH/orqa2BSLnbWiAv+EF OEcA== 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=odDc91bxdxAD2UYjeZVEGqOe60eJ92gn5XLeoNASEGQ=; fh=+hm/0mWpOwx5vUwQFqg7TUR5phUxQgOi8rSeuI2z51w=; b=q/3iv34vQefidfSUVE0raE5xdHkBzTzJdaK70ViE7QGq0TmoRKgWlF5wInDiL4rN94 oHPyUFog0WOioy4+LVtH7T86QgFaZjNZIdKvp+6AVEBt4nCrozpYlrdNfYIWsY0UqJNz BwLfgnHF/toTqQjv/ogmJ/bas2Sah2cnmf69CSvkmqdsaB2UlWkwedFOAVBtIHH+QZ2F v3wt4bvG7sa9sVubBwzCeRwDil5VB3onqyWybebYhKlc9dBQoNOjyQOE/jf1PEIfVEBb lkWcrvIOU02gkZtSwcsIZMEurqg0vnqejZHLBnazIY+OHQ3Yql1gcZ19mmHw/G9jyjzQ 3ieA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b6-20020a170903228600b001cfbb926859si8392568plh.387.2023.12.04.14.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 14:05:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 21BA6809F3BE; Mon, 4 Dec 2023 14:05:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234279AbjLDWFj (ORCPT + 99 others); Mon, 4 Dec 2023 17:05:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231195AbjLDWF2 (ORCPT ); Mon, 4 Dec 2023 17:05:28 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EA16CD for ; Mon, 4 Dec 2023 14:05:35 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rAH4G-0003Eq-Uv; Mon, 04 Dec 2023 23:05:32 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAH4G-00DbY6-I5; Mon, 04 Dec 2023 23:05:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAH4G-00EMXA-95; Mon, 04 Dec 2023 23:05:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski Cc: Greg Kroah-Hartman , Rob Herring , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v2 3/3] w1: gpio: rename pointer to driver data from pdata to ddata Date: Mon, 4 Dec 2023 23:05:23 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4335; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=xHTjgY4K9af7P1vNMusocVvYmeNn9kGZK5/hjxTbjaU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbk0iwrlaqHGrugWKtZmWyfwV958P94eltYw5k s9bGNTaSpGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW5NIgAKCRCPgPtYfRL+ TqFkB/9dHTTrpvTiJhJauqJI0ZRre/cfyGBfu6hDGN+SGMJexK2NZrucAy8W81E85QyamsZpttt N3fL5og4hOD+DFYEU1C4cjfkTOzWTc5NHk02RXzcg38yhET1YI+BeyQ8577bxTbE+5GOJyym3yD 11as0zhIKVXjldIEaLOSX2mj4JSKU4c8Yy6X4aJnYc1E3gIW7ltEl+S9N0901eU+njaxBmGeu6l o1jGlRfrUq+zNSf5H/Fr+AE50ue5B6/tXTRurGj3Btyg/IK9wIUtGpgCBP5OQACFLODTa63Tiag vUpjxW2CUQ6ZaKUfQIFxyl38WtPBLDK1S67KHRRzrpmn5gxU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 14:05:53 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784390676194087814 X-GMAIL-MSGID: 1784390676194087814 pdata is a relict when this was still platform data. Signed-off-by: Uwe Kleine-König --- drivers/w1/masters/w1-gpio.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c index 67596428f69b..05c67038ed20 100644 --- a/drivers/w1/masters/w1-gpio.c +++ b/drivers/w1/masters/w1-gpio.c @@ -25,25 +25,25 @@ struct w1_gpio_ddata { static u8 w1_gpio_set_pullup(void *data, int delay) { - struct w1_gpio_ddata *pdata = data; + struct w1_gpio_ddata *ddata = data; if (delay) { - pdata->pullup_duration = delay; + ddata->pullup_duration = delay; } else { - if (pdata->pullup_duration) { + if (ddata->pullup_duration) { /* * This will OVERRIDE open drain emulation and force-pull * the line high for some time. */ - gpiod_set_raw_value(pdata->gpiod, 1); - msleep(pdata->pullup_duration); + gpiod_set_raw_value(ddata->gpiod, 1); + msleep(ddata->pullup_duration); /* * This will simply set the line as input since we are doing * open drain emulation in the GPIO library. */ - gpiod_set_value(pdata->gpiod, 1); + gpiod_set_value(ddata->gpiod, 1); } - pdata->pullup_duration = 0; + ddata->pullup_duration = 0; } return 0; @@ -51,16 +51,16 @@ static u8 w1_gpio_set_pullup(void *data, int delay) static void w1_gpio_write_bit(void *data, u8 bit) { - struct w1_gpio_ddata *pdata = data; + struct w1_gpio_ddata *ddata = data; - gpiod_set_value(pdata->gpiod, bit); + gpiod_set_value(ddata->gpiod, bit); } static u8 w1_gpio_read_bit(void *data) { - struct w1_gpio_ddata *pdata = data; + struct w1_gpio_ddata *ddata = data; - return gpiod_get_value(pdata->gpiod) ? 1 : 0; + return gpiod_get_value(ddata->gpiod) ? 1 : 0; } #if defined(CONFIG_OF) @@ -74,15 +74,15 @@ MODULE_DEVICE_TABLE(of, w1_gpio_dt_ids); static int w1_gpio_probe(struct platform_device *pdev) { struct w1_bus_master *master; - struct w1_gpio_ddata *pdata; + struct w1_gpio_ddata *ddata; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; /* Enforce open drain mode by default */ enum gpiod_flags gflags = GPIOD_OUT_LOW_OPEN_DRAIN; int err; - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) + ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); + if (!ddata) return -ENOMEM; /* @@ -99,23 +99,23 @@ static int w1_gpio_probe(struct platform_device *pdev) if (!master) return -ENOMEM; - pdata->gpiod = devm_gpiod_get_index(dev, NULL, 0, gflags); - if (IS_ERR(pdata->gpiod)) { + ddata->gpiod = devm_gpiod_get_index(dev, NULL, 0, gflags); + if (IS_ERR(ddata->gpiod)) { dev_err(dev, "gpio_request (pin) failed\n"); - return PTR_ERR(pdata->gpiod); + return PTR_ERR(ddata->gpiod); } - pdata->pullup_gpiod = + ddata->pullup_gpiod = devm_gpiod_get_index_optional(dev, NULL, 1, GPIOD_OUT_LOW); - if (IS_ERR(pdata->pullup_gpiod)) { + if (IS_ERR(ddata->pullup_gpiod)) { dev_err(dev, "gpio_request_one " "(ext_pullup_enable_pin) failed\n"); - return PTR_ERR(pdata->pullup_gpiod); + return PTR_ERR(ddata->pullup_gpiod); } - master->data = pdata; + master->data = ddata; master->read_bit = w1_gpio_read_bit; - gpiod_direction_output(pdata->gpiod, 1); + gpiod_direction_output(ddata->gpiod, 1); master->write_bit = w1_gpio_write_bit; /* @@ -133,8 +133,8 @@ static int w1_gpio_probe(struct platform_device *pdev) return err; } - if (pdata->pullup_gpiod) - gpiod_set_value(pdata->pullup_gpiod, 1); + if (ddata->pullup_gpiod) + gpiod_set_value(ddata->pullup_gpiod, 1); platform_set_drvdata(pdev, master); @@ -144,10 +144,10 @@ static int w1_gpio_probe(struct platform_device *pdev) static int w1_gpio_remove(struct platform_device *pdev) { struct w1_bus_master *master = platform_get_drvdata(pdev); - struct w1_gpio_ddata *pdata = master->data; + struct w1_gpio_ddata *ddata = master->data; - if (pdata->pullup_gpiod) - gpiod_set_value(pdata->pullup_gpiod, 0); + if (ddata->pullup_gpiod) + gpiod_set_value(ddata->pullup_gpiod, 0); w1_remove_master_device(master);