From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753943AbcAOH6Q (ORCPT ); Fri, 15 Jan 2016 02:58:16 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34105 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751325AbcAOH6O (ORCPT ); Fri, 15 Jan 2016 02:58:14 -0500 From: Peter Korsgaard To: "Yang\, Wenyou" Cc: Lee Jones , Rob Herring , "Pawel Moll" , Mark Rutland , "Ian Campbell" , Kumar Gala , "devicetree\@vger.kernel.org" , "Krzysztof Kozlowski" , "Ferre\, Nicolas" , "linux-kernel\@vger.kernel.org" , Javier Martinez Canillas , "linux-arm-kernel\@lists.infradead.org" Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver References: <1452747845-2962-1-git-send-email-wenyou.yang@atmel.com> <1452747845-2962-2-git-send-email-wenyou.yang@atmel.com> <87pox41dy9.fsf@dell.be.48ers.dk> Date: Fri, 15 Jan 2016 08:58:10 +0100 In-Reply-To: (Wenyou Yang's message of "Fri, 15 Jan 2016 01:16:11 +0000") Message-ID: <8737tzz33h.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Yang," == Yang, Wenyou writes: Hi, >> Why not make it a tristate instead? Having regulators as modules is perhaps not a >> very wise thing to do, but conceptually I don't see why this code couldn't be a >> module. > Yes, you are right. it can be use a tristate. Ok, good. >> > + act8945a = devm_kzalloc(&i2c->dev, sizeof(*act8945a), GFP_KERNEL); >> > + if (!act8945a) >> > + return -ENOMEM; >> > + >> >> What is the point of this structure (and the header file)? Can't the subdevices just >> do dev_get_regmap(dev->parent)? regulator_register() afaik already does this by >> default. > Yes, I re-read regulator_register() code. It did do dev_get_regmap(dev->parent). > I think this structure should be pointed by dev->parent, this structure is necessary. > Yes regulator driver should be simpler. > Moreover, it is used by another sub device, charger. Which don't such code. But the charger driver can just as well do: dev_get_regmap(dev->parent); instead of: dev_get_drvdata(pdev->dev.parent)->regmap. -- Venlig hilsen, Peter Korsgaard