From patchwork Thu Oct 24 16:38:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 177540 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp2399880ocf; Thu, 24 Oct 2019 09:38:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZmCJPlQJuVouxCf6gQ1unT72O/iZ2I25QYkA+PGcvRdqeHlcutnCWt/nOq35eT5Aw3u8e X-Received: by 2002:a17:906:c801:: with SMTP id cx1mr39608824ejb.266.1571935122664; Thu, 24 Oct 2019 09:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571935122; cv=none; d=google.com; s=arc-20160816; b=ec23CZ11+NwCAxR0tU3ZbiRD4mrmyeSo9phceRcX9RSDGcl0HwrOGeXBC+0/lsUYL3 wpO4MB9tGlkB4aSHuMDb3Hs+Gbbc2fT2YE+j7WBc6rTH2POGoMsT/LW1+Vrab57FW1ey IUMnriuXnzwub1qRysX37YII7vmMAD1G0V2GOpZFGHl6l1HUUIubrLd+jCKkS8jt0Hyx xUodKujjNFOTTBvVDIeVJg1lnj0yFmY5VNyV35Kchv7HTGLYcsZu4fh1fB5whbHYbbDb DwgJhLj4ANoS5gDTz17Kys71HBNNg4jxkZu2VHUjCZEURObjYYy98DD0t+vgBF+7hGBU T85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=dYt5aHbdAcoo6iOaj0orMUSAvQMPaS0z8lFzdR/A7V4=; b=NUFOqT7NJUhx2t/SnYYDjik62/WDkoa5YYX8xvFFXxQs3upglvW51dz4KrWjTHOk5C RTOsIXnIRxoQEmg+PxiLqn+m5CjiDSeums91BA6hX7FX+cwMQ5MAWgWFkLGVHNLHCJx9 bngWFQTco1mc/4dmbt0ynt93ei3zzYlKpxCRU5TWxmbVib668rnM7Vn4kBQ2zRoOCpFB 3ASBEkvwdmdi2bL/L/nsQQVzreQEgMyPAhaMMIjmpql9O53URmsaoO4sQICISFWNbw7s oyCnoYh2lSPuMHvyE32mfhLIHyf/GMPXwWmFzSxAEOAFM3k/d0s8zwEv40JHJp/CveED NJZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Ns1ZYl/2"; 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 g31si813582eda.325.2019.10.24.09.38.42; Thu, 24 Oct 2019 09:38:42 -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="Ns1ZYl/2"; 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 S2503501AbfJXQii (ORCPT + 26 others); Thu, 24 Oct 2019 12:38:38 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55657 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2503426AbfJXQih (ORCPT ); Thu, 24 Oct 2019 12:38:37 -0400 Received: by mail-wm1-f68.google.com with SMTP id g24so3569593wmh.5 for ; Thu, 24 Oct 2019 09:38:36 -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=dYt5aHbdAcoo6iOaj0orMUSAvQMPaS0z8lFzdR/A7V4=; b=Ns1ZYl/2Z7R9SELtWm3ZXQehrrSdTOXVC8OUXM2hM0HYtFG2jHyYkGzlMM2tGrTBJ1 PadyzrB/+/j1eT5StN3toKeTz/PAXMrdKQyTCN9tYT3/SrXTiz9OS8EQg9ceVBDcPJ7L YSa27E3euj3OEjinq0HDg27dX+MgxGueXHGRrPQH4u9yXzWJnkWkbzvnb4fsmU0ZWYub kcuwX4TIz5K5q8WW7B/Ef+2cKaUd9IS+JwxARfmgBNUVClV4wHRRliuFbGBmnc0YKw4X 8mAK159WfLfu+f4lRLQkqNbihdts9A4/BXWsd0Ngz+C0SmzIAb52ebd0PPe3zgJzwog4 ToKw== 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=dYt5aHbdAcoo6iOaj0orMUSAvQMPaS0z8lFzdR/A7V4=; b=nF7F4UF2FX1rLB6m6mNznEGqFZ+VFr8hUHFEQAMps4EiSAfQIpAA8q2EQ9MqGhjDW3 O9XL+v8bQjw5EwImRxutwJYtP1JZCL0SqqJns78jT9PdREkX3StICQcSLydwj5znI7+T EFDQprzUSAXesn+LygEhI7tb+jsqQiJd//5uUYy8NiCP0XCC6IhRWFtEWirlvGURiJyx l5s2pgBQ5uc0w2sabR7fkFc3zGgV/xN/SAWPa2qIGXNG9F2s0DjZgDfvDHiZrdkNbDGG dIOtGCE0FTb4YGLZEqIt36NmDuL6W1wKOFBRz3WWRs+yClk/jAkWc+0GwhoRNiReYqUQ omaQ== X-Gm-Message-State: APjAAAWYArogiynG8kBVnD0VFDVgj9n8Z0nyQEjnubXYnaiXc1fQDrE5 RkzDwK4IAbbl6YLVEgZw3j8gnw== X-Received: by 2002:a1c:67d7:: with SMTP id b206mr5566577wmc.68.1571935116224; Thu, 24 Oct 2019 09:38:36 -0700 (PDT) Received: from localhost.localdomain ([95.149.164.99]) by smtp.gmail.com with ESMTPSA id 6sm3446175wmd.36.2019.10.24.09.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:38:35 -0700 (PDT) From: Lee Jones To: daniel.thompson@linaro.org, arnd@arndb.de, broonie@kernel.org, linus.walleij@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, baohua@kernel.org, stephan@gerhold.net, Lee Jones Subject: [PATCH v3 00/10] Simplify MFD Core Date: Thu, 24 Oct 2019 17:38:22 +0100 Message-Id: <20191024163832.31326-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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: 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: Protect against NULL call-back function pointer 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 | 105 +++++++++++------------- drivers/mfd/mfd-core.c | 113 +++++--------------------- include/linux/mfd/core.h | 20 ----- 5 files changed, 65 insertions(+), 187 deletions(-) -- 2.17.1