Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3951543ybg; Fri, 25 Oct 2019 11:11:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaAmw7eg32XOqLqWXR+AvftNO0R+P+RJMTW1PAk6eIVy2A/nmhWBqI4fu6Toc832vsyZK7 X-Received: by 2002:a05:6402:304e:: with SMTP id bu14mr2671702edb.89.1572027076220; Fri, 25 Oct 2019 11:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572027076; cv=none; d=google.com; s=arc-20160816; b=FGIG6wGMH15aoEae8X88eenG3zGaNHb/cF6P3OXg4G4am4opFlWNiatB20sIZpybya 4Zj3kjCLDfY3lNzxalWYRd6ccsmZGAq91/OCZXN6CygqMPm3xHw9bUshmlzOiztLNqXs MmJ1zVn8hbkq9NTSfW5/TOHegsB1K2ce1vRbV1LwKKGZ/oq65vVoNUfa/Kv4rEjtYrvc bJXPIhshmLV+mq5aMnz/ZjeVuj3hdexWyJuiyXXgcziNpVi0NXL/tNDb4DYLj+O/gcHX UCeb1WFtzXadtn6RedKcrkhNhzEbLhO6NVY3Q4PD1tS7ofOhZ230yCBjcyBnMqh97VE2 qwrw== 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 q8si2041090edi.445.2019.10.25.11.10.52; Fri, 25 Oct 2019 11:11:16 -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 S2503497AbfJXQii (ORCPT + 99 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