Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4105453ybg; Mon, 21 Oct 2019 03:59:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhkrWhVxIv27YmXHCd2DtKgDYoxtmaoVzIOTacTH32IkZqW9dbVo1atibXALlNzS6Oyj5z X-Received: by 2002:a17:906:7212:: with SMTP id m18mr21339355ejk.88.1571655541289; Mon, 21 Oct 2019 03:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571655541; cv=none; d=google.com; s=arc-20160816; b=FM/1bS5hmgDlmDI1z5sv2HCjMwpICvPyznjrWqjByefZjnDfJ8ssSBTabZRFHYWAMF MdF6cntVcuXmB6JYnGFctGpUN/ugPvsEIo+GGVp2jj1qwkg7C+mOiqovFGZSBDb2UIce mrhF6VY4xbvyoffwJkGCZ3QevH8PMQOkBI4k7uZp4tXC5EeC0h7IALM32J8aEa4/KW1u zAdC22L21Dyxf9G7+Dc1REbYL/6ZmNc1x2kk+3ku9UnB8jZGpIlPOqcazXW51H8AnM/J L+NVkrWvtRiD49lVpQNrkV+3D74Eb+zk6zOD/peophRPhYbxgVwbjqRZH5gACW4OWn0W PK/A== 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=M+Rr/WbPC8m7dZLhfszJHtex79KIwoH5LRc6fwcboyc=; b=VtAkvIcahZDfZV96C/t/rh8lofJFBXcu9K3DAN0BK7XR/ekjR+S44NycZcprPDZXkH i+920WWSgCsr0QANb0vaV3yitMdq9+k5Ee7KSaqtrn1W26gimuE9nLhp9CUeNBbhmXFE X+FvK+WAE3MJ5tuhbiycMTJY/QU5crB6VXLtOqV8gFK8QNm4VHcjm1UV3r/bcJq1UY/6 HoF+SWwczfRQ4ZRN3P8LwV109VyJahvzceyBnv/Zyx0w2xIwX5awXqzklk9avB5ZFM56 WJvATqsUk9L/c50HChG/PXbvQt/tfFOwuUgFQDcws1HwKL4aQRJTvroo0NXn1TUJGFnR LPGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xEhVtga6; 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 v20si8958643edq.195.2019.10.21.03.58.38; Mon, 21 Oct 2019 03:59:01 -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=xEhVtga6; 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 S1727433AbfJUK62 (ORCPT + 99 others); Mon, 21 Oct 2019 06:58:28 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37287 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727058AbfJUK61 (ORCPT ); Mon, 21 Oct 2019 06:58:27 -0400 Received: by mail-wm1-f67.google.com with SMTP id f22so12292741wmc.2 for ; Mon, 21 Oct 2019 03:58:26 -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=M+Rr/WbPC8m7dZLhfszJHtex79KIwoH5LRc6fwcboyc=; b=xEhVtga6MQRbG6XAjBCACpSU2T15US9KjrquctDHuyVAap92YsR4cpqZxx2G5wqwtw ua/RA9+ma6tcuCAlgqO8oSmy3+2IFSb4BlVTWZKEGr9GajuSihUV3DE8khNmcmFYtiMF MEqNJ2rvrw0GjYVb3MOf+F/qm7FO0UNbewTyd1M1m3C0ymePmRk2531mV+YdyoGtf7ig AL/rCtOUhQyNJtiBGvKqBYud+v2dZIN/s0VGGekoBELHF8OeUGVWQTIe4l2CNXt0TB9H wuaXEWJhnF/8GTR5539dLHqIVqAL7baluYHVUg3fBY2GlvEJ7+ZZIxmAMU/eZFjCFrXd UcoQ== 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=M+Rr/WbPC8m7dZLhfszJHtex79KIwoH5LRc6fwcboyc=; b=ELV+U4qN0olLrgOQ0g07rhizvwi2Ts5eD7zLqJIVeOFWOTGlePspX1xyigOK3dB8ho 5QKPA4L3BavQ3cExxqmEA5i6xUmauNnYKHKTRsW5fRpt619y6dC655Q1Ir5KZzcp7nD3 0Bl9ZZD65MbElEIKx9cqYa/xpN/eua1NOlZmTWn0j/qHJc3+b2jghAns3VvfMVDBmK5c iLtGPygAckX9u1w4yPyxZN8ZDpAsaOi0Xs24dECE0BVw08gphgaeXW9LGqPCFET6iaAW sMuQlVh9HT4TjuiJJa5+NvesUy7KqVadO2lVHIDoeU6i7oxEs679Sz9Mh4W9FWH2Aqms gPng== X-Gm-Message-State: APjAAAXN9qkdFchTsqyFYuFazHC2AU47MoJCYt/UqmJRcgi+cJOlYezj CnUOXtxfSREUiY3PIoMPaQEdhA== X-Received: by 2002:a1c:f305:: with SMTP id q5mr18617648wmq.137.1571655505510; Mon, 21 Oct 2019 03:58:25 -0700 (PDT) Received: from localhost.localdomain ([95.149.164.99]) by smtp.gmail.com with ESMTPSA id q22sm12544289wmj.31.2019.10.21.03.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 03:58:25 -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 v2 0/9] Simplify MFD Core Date: Mon, 21 Oct 2019 11:58:13 +0100 Message-Id: <20191021105822.20271-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 (9): 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: 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 | 6 -- drivers/mfd/cs5535-mfd.c | 124 +++++++++++++-------------- drivers/mfd/mfd-core.c | 113 ++++-------------------- include/linux/mfd/core.h | 20 ----- 4 files changed, 79 insertions(+), 184 deletions(-) -- 2.17.1