Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4045401ybg; Fri, 25 Oct 2019 12:31:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLyjeLIuFda7T/2TFyIfD1ythBfHEF5jt3Ow1a9arZ71eGnlXGeT2vndIVDZ7VyToyaqi+ X-Received: by 2002:a17:907:397:: with SMTP id ss23mr5142614ejb.177.1572031913175; Fri, 25 Oct 2019 12:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031913; cv=none; d=google.com; s=arc-20160816; b=ZBYbvtQr/j+t+9SZ1hwzsQrquSaObtlPaaPJOy/6Mi2n9f2WY3sLNrRUC/LdUduhLY 6Am2nAuQ/9/IJzILw1805iv9bm6Ka/69m/SsXx3jrOfO4JIemIagMc+HNCzAMEsQq/Gz RAsx4FNz/C1GYpENc5S4u/EId3e759PyeksmU1lkJ13GO5QexyCDs+IF09uWblxkKjsw qwCwr/JAoBVlQvvkrUguqpaHyYciNPWxmp8ob7KZEb+8Y+vcWkHy/SoIXl5jFc5gP7Zm xHQPQlLGQsGtFaOy4EsOEq8atSvSTBPgTaJ4ot2hJUoJabjlGDnUB5qVTQAPC86wmvla NkuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Za+k390P96EYSItDepM5dTHhQrr03QyXzfLr1/CgGOk=; b=a8/Um7Dlj2ejukU2pjuhvh1tLsKfASVdOZn3k9BTzN798ToZuy4fJAfYePiYTVyxKN tYyKO+zwhMChs6MP0BgMRrloB1bbGgfEvPKlejomqmxCS/ENOkuBy7evjsM0EByY+TJs gX8Q3LAw4Lhff3XG3HWVunfp8bHrDLUVTI/jM8LXJcAcJ9kCMX/fUec5hyez5++QuLlC LxfGgeTIFsfU8N2asJE9c0oKOs1qOdNtTNB2kIWvXmVPlblUn9i4LfOn09/dPShhiJt2 r50Rm45I6q7SpnTWWttOj8jmABb5zZpCNlP0Gm+ZVNajQMa7nKYCj4vu4xFY3WVf7LXz QzHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LSvtfixY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fx11si1883982ejb.302.2019.10.25.12.31.29; Fri, 25 Oct 2019 12:31:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LSvtfixY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438107AbfJYI42 (ORCPT + 99 others); Fri, 25 Oct 2019 04:56:28 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37699 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393338AbfJYI40 (ORCPT ); Fri, 25 Oct 2019 04:56:26 -0400 Received: by mail-wr1-f65.google.com with SMTP id e11so1369902wrv.4 for ; Fri, 25 Oct 2019 01:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Za+k390P96EYSItDepM5dTHhQrr03QyXzfLr1/CgGOk=; b=LSvtfixYphn1xvmJLPG4xBTjQ7hqgGvgq1+mPntlD8fi5f4h8YKYgCwpXkbFX6/fe+ fRf9pY1fyyidqk0Xkvx4W+3xLBGvFWcZzFXra7cW0QAyx4PSmXKg4XC1X57hCTWJVzEI hYXRzBOKNHUPFZ7zeE9/x3KMFLn6BkkIN7oGtfrukb2ELldOfeyQ0+Jg/NAvg0cZDbz5 dbXDybMmt5ptDPiDoIyXUDaPFwJBRBHSCAH3h28TXK0e85Mssz1DYVvqDzRLqZj2HS8s 517Yn8K4zb3+8o9PMEFcixmTiiRzLbqQ0T5vpPX6Z5kF3M5TeYtpGQ4ILJZGGFLGAu1G vJow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Za+k390P96EYSItDepM5dTHhQrr03QyXzfLr1/CgGOk=; b=SnPrhrZS58im8BaQo8ME9IRHrzkG/38x2b/WPnLyekwDffL5Mm9nHhtQVnEmNK4fzc RK9DE2dgJvA+9bRjuhd73NP3lkLEAgl8Reiw18xkRIh6V6otNU5JdmyY2/xubQn002Ys 0FP4nxCjffDeyEVCd32wQ+6WfaPvDw1mp6DBB9LRbTfhRRTmrTJ00ZNeAo4XtbfmDQI2 SS8R/NDUWA7Y++mmiLlyd5PLV+AipiJeRNLxLEqusZDsaS9M7IPw2kQ3zuTpeORApS+h UeJyU7+BJexeMg4jwtQDKQlUJ1qIVJOJpZVgbYvCuFoLJfRA8dt7MU4SSdxuLlqf6Cxz eBbw== X-Gm-Message-State: APjAAAUkpE/WmEzRS8hWRzZZNPNgEI0Z/o4ZJ1HM2oj34cnC89OZjs6I o3TJDSIbTXWAXVcggN8Yyywrmw== X-Received: by 2002:adf:ee10:: with SMTP id y16mr1843678wrn.67.1571993784357; Fri, 25 Oct 2019 01:56:24 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id c16sm1918320wrw.32.2019.10.25.01.56.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 01:56:23 -0700 (PDT) Date: Fri, 25 Oct 2019 09:56:22 +0100 From: Daniel Thompson To: Lee Jones Cc: arnd@arndb.de, broonie@kernel.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, baohua@kernel.org, stephan@gerhold.net Subject: Re: [PATCH v3 10/10] mfd: mfd-core: Move pdev->mfd_cell creation back into mfd_add_device() Message-ID: <20191025085622.7gdfbaesiwgnrfd3@holly.lan> References: <20191024163832.31326-1-lee.jones@linaro.org> <20191024163832.31326-11-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191024163832.31326-11-lee.jones@linaro.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 24, 2019 at 05:38:32PM +0100, Lee Jones wrote: > Most of the complexity of mfd_platform_add_cell() has been removed. The > only functionality left duplicates cell memory into the child's platform > device. Since it's only a few lines, moving it to the main thread and > removing the superfluous function makes sense. > > Signed-off-by: Lee Jones Reviewed-by: Daniel Thompson > --- > drivers/mfd/mfd-core.c | 21 ++++----------------- > 1 file changed, 4 insertions(+), 17 deletions(-) > > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index 2535dd3605c0..cb3e0a14bbdd 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -49,19 +49,6 @@ int mfd_cell_disable(struct platform_device *pdev) > } > EXPORT_SYMBOL(mfd_cell_disable); > > -static int mfd_platform_add_cell(struct platform_device *pdev, > - const struct mfd_cell *cell) > -{ > - if (!cell) > - return 0; > - > - pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL); > - if (!pdev->mfd_cell) > - return -ENOMEM; > - > - return 0; > -} > - > #if IS_ENABLED(CONFIG_ACPI) > static void mfd_acpi_add_device(const struct mfd_cell *cell, > struct platform_device *pdev) > @@ -141,6 +128,10 @@ static int mfd_add_device(struct device *parent, int id, > if (!pdev) > goto fail_alloc; > > + pdev->mfd_cell = kmemdup(cell, sizeof(*cell), GFP_KERNEL); > + if (!pdev->mfd_cell) > + goto fail_device; > + > res = kcalloc(cell->num_resources, sizeof(*res), GFP_KERNEL); > if (!res) > goto fail_device; > @@ -183,10 +174,6 @@ static int mfd_add_device(struct device *parent, int id, > goto fail_alias; > } > > - ret = mfd_platform_add_cell(pdev, cell); > - if (ret) > - goto fail_alias; > - > for (r = 0; r < cell->num_resources; r++) { > res[r].name = cell->resources[r].name; > res[r].flags = cell->resources[r].flags; > -- > 2.17.1 >