Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp772038ybh; Thu, 12 Mar 2020 10:50:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu13ejZwPR4KzGatUOTap0aJw+qLd8T+ppamtuTrHq/LE+SroIH0TEtuOcB6V7/CBJrIu/4 X-Received: by 2002:a05:6808:289:: with SMTP id z9mr3414484oic.48.1584035410660; Thu, 12 Mar 2020 10:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584035410; cv=none; d=google.com; s=arc-20160816; b=o4ka6IuBtQg3eAQrIwJDkuSoUGEr2eOQ5/DkHBEeMFpVi/AIb9Z42a3oVWTsZkZrP2 iQLsJcfDX4g/ZdH6rkMYLH0rTxi5W2sw2XyVnjMwk3iIm4eSlNiZ/Gfwx0gBVLIboMPd jCDlEepbQbQCavEsehZNjU610aiLWYjQO+b0/QszVvO2hZk/lQ10z2GEwtszOWUu5MjX W8N004jiPR3fF4y7p3LdM4+fvIVtvf0F7PYZOMeLBD2FP3oARa/KhKhEiCj/BWjH9LW+ MYKhjiw9HPLCf9d9tGJOEPIg+d/cbUrGtWnI2sAVU13psKJXxRPqogIEWcTagZ83C4P8 1Qpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/qX7I6mTcVU9dPMjZWaP9qhxqzP27zP0nm3Em4+R0lI=; b=y4boSNdj6QPbfcIgiPpW7ZY0Kbq32chb/MkmjSTQmq2flGNbSdqEVL0Yi68AOAgPx0 wxZOyqFk8wGePG4AZz0VhYuNNAAp03cy1U8hhteVAQvUDFdcB83Qb64Zh6fuY0sKEnjl A/RLCI2M15lphXr2QEy52QkrGcmRRnhJBvIpoXUedngIhU5MVwPzQqG1CoWeXSURPP/H 0n3POXpc57tpYf1LY1PGCMDpscqqSMDzob42xxrWrp/vk3PkSp5+hlusx1ivFBEOgHSH jwKZ4G7h//m01PTixSxVSF+SyxxOvJ0VV3XIWE+N9CfW6TBJGewEYrS8sTBGqWZsKxOR KCWw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n198si2935153oig.37.2020.03.12.10.49.56; Thu, 12 Mar 2020 10:50:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgCLRtk (ORCPT + 99 others); Thu, 12 Mar 2020 13:49:40 -0400 Received: from mga04.intel.com ([192.55.52.120]:16068 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726420AbgCLRtj (ORCPT ); Thu, 12 Mar 2020 13:49:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Mar 2020 10:49:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,545,1574150400"; d="scan'208";a="246448945" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006.jf.intel.com with ESMTP; 12 Mar 2020 10:49:32 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jCRxd-00944x-F9; Thu, 12 Mar 2020 19:49:33 +0200 Date: Thu, 12 Mar 2020 19:49:33 +0200 From: Andy Shevchenko To: Saravanan Sekar Cc: lee.jones@linaro.org, robh+dt@kernel.org, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, sre@kernel.org, mchehab+huawei@kernel.org, davem@davemloft.net, gregkh@linuxfoundation.org, fabrice.gasnier@st.com, beniamin.bia@analog.com, linus.walleij@linaro.org, u.kleine-koenig@pengutronix.de, fabrizio.castro@bp.renesas.com, info@metux.net, hancock@sedsystems.ca, gregory.clement@bootlin.com, renatogeh@gmail.com, plr.vincent@gmail.com, miquel.raynal@bootlin.com, marcelo.schmitt1@gmail.com, paul@crapouillou.net, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 2/5] mfd: mp2629: Add support for mps battery charger Message-ID: <20200312174933.GJ1922688@smile.fi.intel.com> References: <20200312172649.13702-1-sravanhome@gmail.com> <20200312172649.13702-3-sravanhome@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200312172649.13702-3-sravanhome@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 12, 2020 at 06:26:46PM +0100, Saravanan Sekar wrote: > mp2629 is a highly-integrated switching-mode battery charge management > device for single-cell Li-ion or Li-polymer battery. > > Add MFD core enables chip access for ADC driver for battery readings, > and a power supply battery-charger driver ... > drivers/mfd/Kconfig | 43 +++++---------- Why do you have unrelated changes here? ... > +int mp2629_set_value(struct regmap *map, u8 reg, u8 mask, unsigned int val) > +{ > + return regmap_update_bits(map, reg, mask, val); > +} > +EXPORT_SYMBOL(mp2629_set_value); > + > +int mp2629_get_value(struct regmap *map, u8 reg, unsigned int *val) > +{ > + return regmap_read(map, reg, val); > +} > +EXPORT_SYMBOL(mp2629_get_value); I'm wondering why a child can get access to parent's regmap? I.o.w. why is this being exported? ... > +static int mp2629_probe(struct i2c_client *client) > +{ > + struct mp2629_info *info; > + int ret; > + > + info = devm_kzalloc(&client->dev, sizeof(struct mp2629_info), > + GFP_KERNEL); info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL); will be shorter. > + if (!info) > + return -ENOMEM; > + ret = devm_mfd_add_devices(info->dev, -1, mp2629mfd, > + ARRAY_SIZE(mp2629mfd), NULL, > + 0, NULL); -1 has a defined name in this case. > + if (ret) > + dev_err(info->dev, "Failed to add mfd %d\n", ret); > + > + return ret; > +} ... > +static const struct of_device_id mp2629_of_match[] = { > + { .compatible = "mps,mp2629"}, > + {}, Terminator line doesn't require comma. > +}; ... > +static const struct i2c_device_id mp2629_id[] = { > + { "mp2629", }, > + { }, Ditto. > +}; > +MODULE_DEVICE_TABLE(i2c, mp2629_id); ... > + .of_match_table = of_match_ptr(mp2629_of_match), of_match_ptr() is redundant and even might provoke compiler warning... > + .probe_new = mp2629_probe, ...especially taking into consideration ->probe_new(). ... > +#include No user here. (Hint: Use forward declaration of struct device instead) > +#include Ditto. > +#include Ditto. (Hint: Use forward declaration of struct regmap instead) But linux/types.h is actually missed. > +int mp2629_set_value(struct regmap *map, u8 reg, u8 mask, unsigned int val); > +int mp2629_get_value(struct regmap *map, u8 reg, unsigned int *val); -- With Best Regards, Andy Shevchenko