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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C628FC4332F for ; Fri, 11 Feb 2022 10:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349016AbiBKKf3 (ORCPT ); Fri, 11 Feb 2022 05:35:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349053AbiBKKfW (ORCPT ); Fri, 11 Feb 2022 05:35:22 -0500 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 714A6F1D; Fri, 11 Feb 2022 02:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1644575716; x=1676111716; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=VSQeArOnGdl7FcIKdua2NdAwZTNifoQ+KWawkwDJKbI=; b=Ic9/BJZX6iXH/PYtts4WOYLxPs5OyF4rnJMJ8Jk+EJXOWNMaAyn8C2xF uzWV6SiRVJ6+wR+YNX6LSiHCJdFLQ5BAfNDjv3BO4FqMfAeJ4i/rzFbo/ kjH+cZb2trPf6ZlRiXhV5toyFU0LqpvxJ4Zzk40o4A+BQKA604t1uOF+S U=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 11 Feb 2022 02:35:16 -0800 X-QCInternal: smtphost Received: from nalasex01a.na.qualcomm.com ([10.47.209.196]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 02:35:15 -0800 Received: from [10.216.7.73] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.19; Fri, 11 Feb 2022 02:35:10 -0800 Subject: Re: [PATCH V5 4/6] regulator: Add a regulator driver for the PM8008 PMIC To: Bjorn Andersson CC: Rob Herring , Krzysztof Kozlowski , Lee Jones , "Liam Girdwood" , Mark Brown , "Das Srinagesh" , , , , , , , References: <1644331940-18986-1-git-send-email-quic_c_skakit@quicinc.com> <1644331940-18986-5-git-send-email-quic_c_skakit@quicinc.com> From: "Satya Priya Kakitapalli (Temp)" Message-ID: <653bc533-8dca-cd9c-3ca0-d5628da37f4a@quicinc.com> Date: Fri, 11 Feb 2022 16:05:07 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2/11/2022 6:27 AM, Bjorn Andersson wrote: > On Tue 08 Feb 08:52 CST 2022, Satya Priya wrote: >> diff --git a/drivers/regulator/qcom-pm8008-regulator.c b/drivers/regulator/qcom-pm8008-regulator.c > [..] >> +static int pm8008_regulator_probe(struct platform_device *pdev) >> +{ >> + struct device *dev = &pdev->dev; >> + int id = pdev->id % PM8008_NUM_LDOS; > Why does this driver look completely different from all the other > Qualcomm regulator drivers that we already have, and why do you register > one platform_device per regulator? Based on Mark's suggestions and the discussion happened here [1], I've changed the design like this. [1] https://patchwork.kernel.org/project/linux-arm-msm/patch/1637314953-4215-3-git-send-email-quic_c_skakit@quicinc.com/ > The fundamental difference in design makes it hard to maintain and > you're wasting quite a bit of memory with the unnecessary > platfrom_device objects. I'm going to change this. I will add only one cell with .name to match with the regulator driver and probe all the regulators using a single loop. That way we don't waste lot of memory by registering multiple regulator platform devices. > Regards, > Bjorn