Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742AbbGWOZU (ORCPT ); Thu, 23 Jul 2015 10:25:20 -0400 Received: from mail-yk0-f179.google.com ([209.85.160.179]:33612 "EHLO mail-yk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753442AbbGWOZL (ORCPT ); Thu, 23 Jul 2015 10:25:11 -0400 MIME-Version: 1.0 X-Originating-IP: [213.143.60.31] In-Reply-To: <1437649445.30329.90.camel@mtksdaap41> References: <1437622799-28115-1-git-send-email-henryc.chen@mediatek.com> <1437622799-28115-3-git-send-email-henryc.chen@mediatek.com> <1437649445.30329.90.camel@mtksdaap41> Date: Thu, 23 Jul 2015 16:25:10 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] regulator: mt6311: Add support for mt6311 regulator From: Javier Martinez Canillas To: Henry Chen Cc: Mark Brown , Mark Rutland , Liam Girdwood , Linux Kernel , linux-mediatek@lists.infradead.org, Sascha Hauer , Matthias Brugger , eddie.huang@mediatek.com, "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1752 Lines: 61 Hello Henry, On Thu, Jul 23, 2015 at 1:04 PM, Henry Chen wrote: > On Thu, 2015-07-23 at 11:07 +0200, Javier Martinez Canillas wrote: > >> > + >> > + if (ret < 0) >> > + dev_err(&i2c->dev, "Failed to initialize regulator: %d\n", ret); >> > + >> >> I don't think this is necessary, you are already adding logs for all >> the error conditions. > > Yes, I will remove it. > >> >> > + return ret; >> > +} >> > + >> > +static const struct i2c_device_id mt6311_i2c_id[] = { >> > + {"mt6311", 0}, >> > + {}, >> > +}; >> > +MODULE_DEVICE_TABLE(i2c, mt6311_i2c_id); >> > + >> > +#ifdef CONFIG_OF >> > +static const struct of_device_id mt6311_dt_ids[] = { >> > + { .compatible = "mediatek,mt6311-regulator", >> > + .data = &mt6311_i2c_id[0] }, >> > + {}, >> > +}; >> > +MODULE_DEVICE_TABLE(of, mt6311_dt_ids); >> > +#endif >> > + >> > +static struct i2c_driver mt6311_regulator_driver = { >> > + .driver = { >> > + .name = "mt6311", >> > + .owner = THIS_MODULE, >> > + .of_match_table = of_match_ptr(mt6311_dt_ids), >> >> of_match_ptr() is NULL when CONFIG_OF is not defined so you don't need >> the additional #ifdef >> CONFIG_OF around mt6311_dt_ids. > > If CONFIG_OF is not defined and without #ifdef CONFIG_OF around > mt6311_dt_ids, it will allocate a struct mt6311_dt_ids but no one used > on here, right? > You are right, sorry for the noise. > Henry > Best regards, Javier -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/