Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp34299pxb; Wed, 18 Nov 2020 15:45:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEh5lyU2Mizft8aeKkRJume1uODSP0736fsCIMlvmVEwZ8t888KGzpmNPGiV6sxKf0JlLP X-Received: by 2002:a17:906:66c9:: with SMTP id k9mr27297488ejp.204.1605743108124; Wed, 18 Nov 2020 15:45:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605743108; cv=none; d=google.com; s=arc-20160816; b=DodrVpyrwQikVLsCtLq6usTm+6qZfLRyB+D/j/bhEEO0eciO6/Kw46IALHLUs1XzWU 7JL9jMRWBUT8hsuYzwUT90MO+cHZEahkZ1dHBfySiU5yCSE0kGiyPCKCen/oUB2tzxm5 1BxOBAn58a8ZuSjZVqeVp2VAN5tjRPfSWV+7g0iV3RtXzSU6p8IOWdKak+/BuCcWyJFw z53o/i4fDJERDfl6H86DVxp7bchKE39uCzagGIkjUkBH8A+XWbQt1lhgHRXXzhVqXdSf JZAqSdgb8RoMNmkVBYRaPNVXLgPBS+ImjEF1u5/LLos5P8FEmi75FosPzcZl7ftGulaT T/XA== 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 :dkim-signature; bh=KbXmC12vCkyVcsuizMiLb6hd66fnVjvjA5q9X2HN7hs=; b=QDolyJQrM5lb8HV6C35PqOnoQYpWKKXgN0PoFBLFSU1B/pXoz4k650/3PxS5bGVRPb 9yAbWaSr8weaXUQKff3TQAM1oWjC7C/EqxMjzlUHJbYvcFaZUIGJFfauhifnpLajB3wy T1NsnBBEBWMq1ex3fsg4ouwC06W5mH0smPbhZKrDezZ1zg2Y64dJfWe1VfpvB/FNE4AI nrpGK5zz+1CI16LOg454aem3q+pXODErAJo/XgEhk/A6NfpsvE4pwEKsWr3eX0jGs5tQ r+04Ftdr2nJ+cc3mV1bLyqJY2znDsIW0MbmHzxgv5YA4S1sgAK3xQTrvFM6/IwbVHnzt ncoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IRh3QYaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc4si15771962ejb.200.2020.11.18.15.44.45; Wed, 18 Nov 2020 15:45:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IRh3QYaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727187AbgKRXky (ORCPT + 99 others); Wed, 18 Nov 2020 18:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbgKRXkw (ORCPT ); Wed, 18 Nov 2020 18:40:52 -0500 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D2E8C0613D4 for ; Wed, 18 Nov 2020 15:40:52 -0800 (PST) Received: by mail-pl1-x641.google.com with SMTP id u2so1893229pls.10 for ; Wed, 18 Nov 2020 15:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KbXmC12vCkyVcsuizMiLb6hd66fnVjvjA5q9X2HN7hs=; b=IRh3QYaLc1sLq4WKPbB+pxnO9Emyq7Ia5jPXAIqMNITYy/CplxB5C9j37uZQq4XFAw blJSwLjOMwCIyFQ5Y0jvSEnxYruEZUQmA/juFOQUUVCFuOFgaMzhji45odXNreNAJq+W jo5Yw3abrXP7N+nh4OxVcfgUZJ9gPvN4KpSdo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KbXmC12vCkyVcsuizMiLb6hd66fnVjvjA5q9X2HN7hs=; b=BY/+Y3JUwNkuWmOQ3MNdoSWUCq/Pf722kEGasUSC2dBF82EeGf3NZPDhSGdi2zqCT7 RQdfAEv2oNgFImyYm9rSh7lbKF5mlDuSIlGl6RzxJqYB1TL+89nnmfDDvXRjHgoGRsP3 PFYxZGECYKRYwW5t7/882gynJkSX6bqanDJ6ON1/8SnYb+/qCfZQjsxyLDhuz6TWdf34 mZS8wXAyS1kX3z9VbVkfJ1SfVBxGUeizSBz6AR+A0AP3ljHkF6nUOvmoB7joSIMSstrZ B4VCIWEw4unwbOytcaq0chPi/0+xc/8dawYSmwI60FOBmfDYTngkYFhp0m05fcNe0JOM Etfw== X-Gm-Message-State: AOAM5327qQaqIxOKIHZ1z8J2aGZvI8ujli0Gk8oQUZihX/LY3dvpj2eH WDMXnZ/dv9PKnczblI6f7PgvsT8OoUMiwly/ X-Received: by 2002:a17:902:9a4c:b029:d6:a250:ab9f with SMTP id x12-20020a1709029a4cb02900d6a250ab9fmr6762939plv.20.1605742851984; Wed, 18 Nov 2020 15:40:51 -0800 (PST) Received: from evgreen-glaptop.cheshire.ch ([2601:646:c780:1404:250:b6ff:fee1:7d4c]) by smtp.gmail.com with ESMTPSA id t200sm5210979pfc.143.2020.11.18.15.40.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Nov 2020 15:40:51 -0800 (PST) From: Evan Green To: Peter Rosin Cc: Andy Shevchenko , Wolfram Sang , Randy Dunlap , Evan Green , Peter Korsgaard , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH v3 1/2] i2c: i2c-mux-gpio: Factor out pdev->dev in _probe_dt() Date: Wed, 18 Nov 2020 15:40:24 -0800 Message-Id: <20201118153951.RESEND.v3.1.Ia45846771c63de3f2418d2b9c767cd95938a164c@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201118234025.376412-1-evgreen@chromium.org> References: <20201118234025.376412-1-evgreen@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Factor out &pdev->dev into a local variable in preparation for the ACPI enablement of this function, which will utilize the variable more. Signed-off-by: Evan Green --- Changes in v3: - Introduced minor &pdev->dev to dev refactor (Peter) drivers/i2c/muxes/i2c-mux-gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 4effe563e9e8d..caaa782b50d83 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c @@ -53,6 +53,7 @@ static int i2c_mux_gpio_deselect(struct i2c_mux_core *muxc, u32 chan) static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, struct platform_device *pdev) { + struct device *dev = &pdev->dev; struct device_node *np = pdev->dev.of_node; struct device_node *adapter_np, *child; struct i2c_adapter *adapter; @@ -77,11 +78,11 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, mux->data.n_values = of_get_child_count(np); - values = devm_kcalloc(&pdev->dev, + values = devm_kcalloc(dev, mux->data.n_values, sizeof(*mux->data.values), GFP_KERNEL); if (!values) { - dev_err(&pdev->dev, "Cannot allocate values array"); + dev_err(dev, "Cannot allocate values array"); return -ENOMEM; } -- 2.26.2