Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4220485ybg; Mon, 21 Oct 2019 05:47:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyX49hpDdCdZLSEFt8KFOnqXNLmMT9pY24dkSdLTJvbHn6dy433yoz3WtA2ra1DC0Qr2hxC X-Received: by 2002:a50:f683:: with SMTP id d3mr3168968edn.70.1571662033897; Mon, 21 Oct 2019 05:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571662033; cv=none; d=google.com; s=arc-20160816; b=LyTP3JRyE8u/f/ABnKeJelQwwrL4KZME4iK2mw9rd//PW6ofBYAFUFmTgsKlCmwW3h rHdxSw/suPCiMUNi8VKjbwWQ6VZFVnaFAUGNH7mKYSpkHNrYCuhMd2kUn/3PA6w1LiOl MuYcCvUnEhXEYTGNywqGCw2jF2oi1YEvNDR36RcTsTfxnEyHUUDVW/UtVfZNXAB72yI+ lYRINGZ9pPiREKNA5ySPv7AMIkcCLybMw2nAJra2PKhI8ZDpoexXbtPy3J+dPwAbylnB lYINfHTZeGCOETaQQ1fDn68d+BQvHRUu8Su5jrtRuXo6DtaZrodKN1I+6CukbDXPFt2d vPjQ== 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=I8rkz9wni1PLYTJYS1CHHJxzqvPcnSWI9WK6axWmJfM=; b=curHB0qnb6N9SVepfeOMIOvZm+s0NRbZ5m0NRV38qN+rMC5Wv4zp1YhYlMomMUZamh 5J1myyj3EmMmztCI6RNKDb/s5tRt6+Psyg7L9T5lSiZg03o0YyNCNegNXxVYyqLI3qOe QzUG8c0WS/hImq2iu66NThjMJzWBSDq7zPlOPjxIQH/AypDfDzuFAH562jd9PdWqymHd Uw9DpKuMs+o2xVnUiXrK0m4zDgwss7BKp0hfg0eFLifhuWBfqmtzps0AmMdYQmFgbDmv FuHiTOkRNIcyA3mj1r1+3LcERIbYv2gnYPR28DjxhkB806+XWRZK5+Q3rFfAJDZ8cg6v wW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AW+3V3g7; 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 b44si9852897ede.451.2019.10.21.05.46.50; Mon, 21 Oct 2019 05:47:13 -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=AW+3V3g7; 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 S1728853AbfJUMpc (ORCPT + 99 others); Mon, 21 Oct 2019 08:45:32 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46256 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbfJUMpb (ORCPT ); Mon, 21 Oct 2019 08:45:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id n15so3021814wrw.13 for ; Mon, 21 Oct 2019 05:45:30 -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=I8rkz9wni1PLYTJYS1CHHJxzqvPcnSWI9WK6axWmJfM=; b=AW+3V3g7BTEklmfuK/i+EY2s9qLVJXAYy0fpcJM/wgGxWc66ja7A848n7hu/YebqvC cGn8QpIu13IAMy9QCkCg8wuiEv+BWTHW27o4lqD2dg2krKmQLjbIZPTQd7H1cT4BZ35q 09qOewOkfv/mN3lSElOw8XSsmQHi0HinSZCOm79vwSpyIyTtpZAio19SmtL5L3Alh49d xwgadWESW2+8eOEHvvuc3/WieljrvTrJLQgeHoSpxKvFzAUytaNHoGNXoyEwg/NSnie9 qcebNcVhvgTcRLFsLpZnDWfQsPm5YwiSDcFHrdpUbZNcrHlO8DDm15gpH6HLN4rMeA8M qFXg== 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=I8rkz9wni1PLYTJYS1CHHJxzqvPcnSWI9WK6axWmJfM=; b=ptXy2k5sDRi+/QsfQFTK0ldSaQbcT1QKqfETYEmA+QieNUntmdW7NuV4VrtBitt7VR pVSFVbe2r87EX5lp5UmBI3pQmi6bWAVjECagmihYE+h3G6BnsnKIhWOGagxm8N6Uu/cc I/+NrvggY5o1MzbBJXGLuFRO4dVXj0Yj7upfS3fzu5U1t2BlEBydEKf0qbHl1K99PBdr xSGrL12HBQ/Bnsy1rwakDQLSduSLYZsYGEuJ1quhVo8sTwpG6liAMwtt7Olu9E5BEjai 98xWrSgwd+YOrjuDgkAsp5HkjQXHQ8NaQ9k921/t3ZKVfuLCBJ0gO0OnunMRdHfMy1d4 Tuqg== X-Gm-Message-State: APjAAAWl41cSJAZWhlqwWLmUD54qYaIyAwB596O0C+slNXHhuWGef0TS Bs9XOEyZ7ZVp3ceiA+f8QyJNbg8na+t+ng== X-Received: by 2002:adf:e28f:: with SMTP id v15mr18991524wri.130.1571661929630; Mon, 21 Oct 2019 05:45:29 -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 q66sm15560273wme.39.2019.10.21.05.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 05:45:28 -0700 (PDT) Date: Mon, 21 Oct 2019 13:45:27 +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 v2 9/9] mfd: mfd-core: Move pdev->mfd_cell creation back into mfd_add_device() Message-ID: <20191021124527.dr4mpys5vovfkk2e@holly.lan> References: <20191021105822.20271-1-lee.jones@linaro.org> <20191021105822.20271-10-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021105822.20271-10-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 Mon, Oct 21, 2019 at 11:58:22AM +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 5d56015baeeb..849dbe3798b0 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 >