From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC23CA9ED0 for ; Fri, 1 Nov 2019 07:45:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B2070208CB for ; Fri, 1 Nov 2019 07:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iTfw9Nab"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DGeGBbSB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2070208CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Z3oHNluXfi54U4rEtQbtRiUE/7sx5uJtZULaS76puGc=; b=iTf w9NabG+QeadWd53H6kBNLOCnsasTIvPxnbj/Bt4It1oEU4CabknBXKb4kEdAeT8GDyX7/Q9Nr+1AB PfycIFtv1iVlswcdZp16ji6FYFhZ3wKjKa8ubK+1gJSGr4T96AAy/EEo4p8BsReugfqCTM6UxUuZ4 8zwIYoC1ZrQOdCvqZ6VWzol6xI0vTKbwgAk8//k0gR8ETLxDdfWxYHoV6qMpB8I33CyWGDRFIhgfZ TjdPkWrEpXfnJ3tJMmoCHn+heds0UbAxVRs9+tyhAgVRVeWPA2fgY7zA9qOvOKvn/H1EV4Sn30ATw pVEHxgo3cyP3dmG/gPhbQ2jAShbR9aA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQRco-0008D8-Ef; Fri, 01 Nov 2019 07:45:38 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iQRcZ-00081V-RB for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2019 07:45:25 +0000 Received: by mail-wr1-x442.google.com with SMTP id l10so8821025wrb.2 for ; Fri, 01 Nov 2019 00:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=to/Y/QniUKkmMiWX6pjQcsRGKsnCzLq5ufaQQdqWZaY=; b=DGeGBbSBF3XBgQkPzpHmCQeFeB+An6cAw2pADw8jObNdktR2wAJYZyaNvNypUUSyzt 3RbLP0F6s/LWdjQ2cyscdEqHYHFEUtbMNkOfeQfvJhKU/DXlesWfI62+9UIsQ2tccQn9 OWp/fMADkVTtJjkM8ktM5ey74wSv2owi1hbyy8xdt5E9ap2yunxrhdcyTLVaC6Skea2U vT8pEVhFT39RWjnZ7upwYsYng+82rk1hWMZxGOLjhx3483Anr/FcD9Z5pienGvAx8/i9 l6gVFD1OFIVMLPnKxE1mvr0oy4Wb86BHYaxly8EacH/EQKrFNXyCqimqN6uL+JyEcqmv hvPg== 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; bh=to/Y/QniUKkmMiWX6pjQcsRGKsnCzLq5ufaQQdqWZaY=; b=CJgITJT0N0b2pzJDMSWRGvSdfHhS8X+S9R1bCzPgNm0CCcEmBi5JmzDXQa7zpFp7eK NHl/zpXPb5Geo/EvYErga2+oE25KzOiJqklwkQTXO4FklnxiXWMhhthaY28rqjX6nolS Qblp4sPvFZoxp2t0INpw6Lv93gyD++U6sw0LzWIxFp/11zq1lKldIcg4j2PwF10I4e69 mNeUcCBo/8clgpAbb0JLpciI8c7hkD5d/w/wlIKgtbFqewAfgmHaQGbwe8zl5JOj6IvC lEwCkant9XHQqTx2SiTUxr6Xpsb5tIHE+z8eXivijvx2kjw6oKzaCidlcDD6bc+JHNRc 3QOQ== X-Gm-Message-State: APjAAAVqPUAFde4TNtbU03PsSk9oJftEvcRvwfSXs3kqntVFFqeqwWMY AWvvrlZ1KPJET8w9N227D+1RqQ== X-Google-Smtp-Source: APXvYqyxjoV/SqOqmBnZZX6r+ePMAOXdffQ7T9WX/+gdTSuCsEL054iIAv0sY38n9RTh2JKXTN0IVg== X-Received: by 2002:a5d:5288:: with SMTP id c8mr2412711wrv.1.1572594321520; Fri, 01 Nov 2019 00:45:21 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.64]) by smtp.gmail.com with ESMTPSA id b1sm576215wrw.77.2019.11.01.00.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 00:45:20 -0700 (PDT) From: Lee Jones To: daniel.thompson@linaro.org, broonie@kernel.org Subject: [PATCH v4 00/10] Simplify MFD Core Date: Fri, 1 Nov 2019 07:45:08 +0000 Message-Id: <20191101074518.26228-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191101_004523_890911_A8EC4029 X-CRM114-Status: UNSURE ( 8.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: baohua@kernel.org, stephan@gerhold.net, arnd@arndb.de, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, Lee Jones , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org MFD currently has one over-complicated user. CS5535 uses a mixture of cell cloning, reference counting and subsystem-level call-backs to achieve its goal of requesting an IO memory region only once across 3 consumers. The same can be achieved by handling the region centrally during the parent device's .probe() sequence. Releasing can be handed in a similar way during .remove(). While we're here, take the opportunity to provide some clean-ups and error checking to issues noticed along the way. This also paves the way for clean cell disabling via Device Tree being discussed at [0]. [0] https://lkml.org/lkml/2019/10/18/612. Lee Jones (10): mfd: cs5535-mfd: Use PLATFORM_DEVID_* defines and tidy error message mfd: cs5535-mfd: Remove mfd_cell->id hack mfd: cs5535-mfd: Request shared IO regions centrally mfd: cs5535-mfd: Register clients using their own dedicated MFD cell entries mfd: mfd-core: Protect against NULL call-back function pointer mfd: mfd-core: Remove mfd_clone_cell() x86: olpc-xo1-pm: Remove invocation of MFD's .enable()/.disable() call-backs x86: olpc-xo1-sci: Remove invocation of MFD's .enable()/.disable() call-backs mfd: mfd-core: Remove usage counting for .{en,dis}able() call-backs mfd: mfd-core: Move pdev->mfd_cell creation back into mfd_add_device() arch/x86/platform/olpc/olpc-xo1-pm.c | 8 -- arch/x86/platform/olpc/olpc-xo1-sci.c | 6 -- drivers/mfd/cs5535-mfd.c | 108 +++++++++++------------- drivers/mfd/mfd-core.c | 113 +++++--------------------- include/linux/mfd/core.h | 20 ----- 5 files changed, 68 insertions(+), 187 deletions(-) -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel