diff mbox

[v5,08/14] mfd: da9063: Replace model with type

Message ID 20180606100003.17067-8-marek.vasut+renesas@gmail.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Marek Vasut June 6, 2018, 9:59 a.m. UTC
The model number stored in the struct da9063 is the same for all
variants of the da9063 since it is the chip ID, which is always
the same. Replace that with a separate identifier instead, which
allows us to discern the DA9063 variants by setting the type
based on either DT match or otherwise.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Steve Twiss <stwiss.opensource@diasemi.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
V2: Drop useless cast of id->driver_data
V3: Fix kernel 0day error , s/dev_model/type/
V4: No change
V5: No change
---
 drivers/mfd/da9063-core.c            | 1 -
 drivers/mfd/da9063-i2c.c             | 5 +++--
 drivers/regulator/da9063-regulator.c | 6 +++---
 include/linux/mfd/da9063/core.h      | 6 +++++-
 4 files changed, 11 insertions(+), 7 deletions(-)

Comments

kernel test robot June 11, 2018, 2:45 p.m. UTC | #1
Hi Marek,

I love your patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.17 next-20180608]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Marek-Vasut/mfd-da9063-Replace-regmap_add_irq_chip-with-devm-counterpart/20180607-152143
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All errors (new ones prefixed by >>):

   drivers/input/joystick/analog.c:176:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp]
    #warning Precise timer not defined for this architecture.
     ^~~~~~~
   drivers/mfd/cros_ec_dev.c:265:13: warning: '__remove' defined but not used [-Wunused-function]
    static void __remove(struct device *dev) { }
                ^~~~~~~~
   drivers/regulator/da9063-regulator.c: In function 'da9063_regulator_probe':
>> drivers/regulator/da9063-regulator.c:749:10: error: 'struct da9063' has no member named 'model'
       da9063->model);
             ^~
   make[3]: *** [drivers/regulator/da9063-regulator.o] Error 1
   make[3]: Target '__build' not remade because of errors.
   make[2]: *** [drivers/regulator] Error 2
   drivers/spi/spi-sh-msiof.c:77:0: warning: "STR" redefined
    #define STR 0x40 /* Status Register */
    
   In file included from arch/mips/include/asm/mach-generic/spaces.h:15:0,
                    from arch/mips/include/asm/addrspace.h:13,
                    from arch/mips/include/asm/barrier.h:11,
                    from include/linux/compiler.h:245,
                    from arch/mips/include/asm/bitops.h:16,
                    from include/linux/bitops.h:38,
                    from include/linux/bitmap.h:8,
                    from drivers/spi/spi-sh-msiof.c:14:
   arch/mips/include/asm/mipsregs.h:29:0: note: this is the location of the previous definition
    #define STR(x) __STR(x)
    
   In file included from arch/mips/include/asm/sibyte/sb1250.h:41:0,
                    from drivers/watchdog/sb_wdog.c:58:
   arch/mips/include/asm/sibyte/bcm1480_scd.h:274:0: warning: "M_SPC_CFG_CLEAR" redefined
    #define M_SPC_CFG_CLEAR   M_BCM1480_SPC_CFG_CLEAR
    
   In file included from arch/mips/include/asm/sibyte/sb1250.h:40:0,
                    from drivers/watchdog/sb_wdog.c:58:
   arch/mips/include/asm/sibyte/sb1250_scd.h:405:0: note: this is the location of the previous definition
    #define M_SPC_CFG_CLEAR  _SB_MAKEMASK1(32)
    
   In file included from arch/mips/include/asm/sibyte/sb1250.h:41:0,
                    from drivers/watchdog/sb_wdog.c:58:
   arch/mips/include/asm/sibyte/bcm1480_scd.h:275:0: warning: "M_SPC_CFG_ENABLE" redefined
    #define M_SPC_CFG_ENABLE  M_BCM1480_SPC_CFG_ENABLE
    
   In file included from arch/mips/include/asm/sibyte/sb1250.h:40:0,
                    from drivers/watchdog/sb_wdog.c:58:
   arch/mips/include/asm/sibyte/sb1250_scd.h:406:0: note: this is the location of the previous definition
    #define M_SPC_CFG_ENABLE _SB_MAKEMASK1(33)
    
   make[2]: Target '__build' not remade because of errors.

vim +749 drivers/regulator/da9063-regulator.c

69ca3e58 Krystian Garbaciak 2013-07-29  715  
69ca3e58 Krystian Garbaciak 2013-07-29  716  static int da9063_regulator_probe(struct platform_device *pdev)
69ca3e58 Krystian Garbaciak 2013-07-29  717  {
69ca3e58 Krystian Garbaciak 2013-07-29  718  	struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
69ca3e58 Krystian Garbaciak 2013-07-29  719  	struct da9063_pdata *da9063_pdata = dev_get_platdata(da9063->dev);
0fdfd40a Geert Uytterhoeven 2013-09-09  720  	struct of_regulator_match *da9063_reg_matches = NULL;
69ca3e58 Krystian Garbaciak 2013-07-29  721  	struct da9063_regulators_pdata *regl_pdata;
69ca3e58 Krystian Garbaciak 2013-07-29  722  	const struct da9063_dev_model *model;
69ca3e58 Krystian Garbaciak 2013-07-29  723  	struct da9063_regulators *regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  724  	struct da9063_regulator *regl;
69ca3e58 Krystian Garbaciak 2013-07-29  725  	struct regulator_config config;
69ca3e58 Krystian Garbaciak 2013-07-29  726  	bool bcores_merged, bmem_bio_merged;
69ca3e58 Krystian Garbaciak 2013-07-29  727  	int id, irq, n, n_regulators, ret, val;
69ca3e58 Krystian Garbaciak 2013-07-29  728  	size_t size;
69ca3e58 Krystian Garbaciak 2013-07-29  729  
69ca3e58 Krystian Garbaciak 2013-07-29  730  	regl_pdata = da9063_pdata ? da9063_pdata->regulators_pdata : NULL;
69ca3e58 Krystian Garbaciak 2013-07-29  731  
69ca3e58 Krystian Garbaciak 2013-07-29  732  	if (!regl_pdata)
69ca3e58 Krystian Garbaciak 2013-07-29  733  		regl_pdata = da9063_parse_regulators_dt(pdev,
69ca3e58 Krystian Garbaciak 2013-07-29  734  							&da9063_reg_matches);
69ca3e58 Krystian Garbaciak 2013-07-29  735  
69ca3e58 Krystian Garbaciak 2013-07-29  736  	if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  737  		dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  738  			"No regulators defined for the platform\n");
b6615659 Dan Carpenter      2017-08-30  739  		return -ENODEV;
69ca3e58 Krystian Garbaciak 2013-07-29  740  	}
69ca3e58 Krystian Garbaciak 2013-07-29  741  
69ca3e58 Krystian Garbaciak 2013-07-29  742  	/* Find regulators set for particular device model */
69ca3e58 Krystian Garbaciak 2013-07-29  743  	for (model = regulators_models; model->regulator_info; model++) {
22fbf3a1 Marek Vasut        2018-06-06  744  		if (model->type == da9063->type)
69ca3e58 Krystian Garbaciak 2013-07-29  745  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  746  	}
69ca3e58 Krystian Garbaciak 2013-07-29  747  	if (!model->regulator_info) {
69ca3e58 Krystian Garbaciak 2013-07-29  748  		dev_err(&pdev->dev, "Chip model not recognised (%u)\n",
69ca3e58 Krystian Garbaciak 2013-07-29 @749  			da9063->model);
69ca3e58 Krystian Garbaciak 2013-07-29  750  		return -ENODEV;
69ca3e58 Krystian Garbaciak 2013-07-29  751  	}
69ca3e58 Krystian Garbaciak 2013-07-29  752  
69ca3e58 Krystian Garbaciak 2013-07-29  753  	ret = regmap_read(da9063->regmap, DA9063_REG_CONFIG_H, &val);
69ca3e58 Krystian Garbaciak 2013-07-29  754  	if (ret < 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  755  		dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  756  			"Error while reading BUCKs configuration\n");
8a7963d5 Sachin Kamat       2014-02-18  757  		return ret;
69ca3e58 Krystian Garbaciak 2013-07-29  758  	}
69ca3e58 Krystian Garbaciak 2013-07-29  759  	bcores_merged = val & DA9063_BCORE_MERGE;
69ca3e58 Krystian Garbaciak 2013-07-29  760  	bmem_bio_merged = val & DA9063_BUCK_MERGE;
69ca3e58 Krystian Garbaciak 2013-07-29  761  
69ca3e58 Krystian Garbaciak 2013-07-29  762  	n_regulators = model->n_regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  763  	if (bcores_merged)
69ca3e58 Krystian Garbaciak 2013-07-29  764  		n_regulators -= 2; /* remove BCORE1, BCORE2 */
69ca3e58 Krystian Garbaciak 2013-07-29  765  	else
69ca3e58 Krystian Garbaciak 2013-07-29  766  		n_regulators--;    /* remove BCORES_MERGED */
69ca3e58 Krystian Garbaciak 2013-07-29  767  	if (bmem_bio_merged)
69ca3e58 Krystian Garbaciak 2013-07-29  768  		n_regulators -= 2; /* remove BMEM, BIO */
69ca3e58 Krystian Garbaciak 2013-07-29  769  	else
69ca3e58 Krystian Garbaciak 2013-07-29  770  		n_regulators--;    /* remove BMEM_BIO_MERGED */
69ca3e58 Krystian Garbaciak 2013-07-29  771  
69ca3e58 Krystian Garbaciak 2013-07-29  772  	/* Allocate memory required by usable regulators */
69ca3e58 Krystian Garbaciak 2013-07-29  773  	size = sizeof(struct da9063_regulators) +
69ca3e58 Krystian Garbaciak 2013-07-29  774  		n_regulators * sizeof(struct da9063_regulator);
69ca3e58 Krystian Garbaciak 2013-07-29  775  	regulators = devm_kzalloc(&pdev->dev, size, GFP_KERNEL);
8b5baa56 Sachin Kamat       2014-02-20  776  	if (!regulators)
69ca3e58 Krystian Garbaciak 2013-07-29  777  		return -ENOMEM;
69ca3e58 Krystian Garbaciak 2013-07-29  778  
69ca3e58 Krystian Garbaciak 2013-07-29  779  	regulators->n_regulators = n_regulators;
69ca3e58 Krystian Garbaciak 2013-07-29  780  	platform_set_drvdata(pdev, regulators);
69ca3e58 Krystian Garbaciak 2013-07-29  781  
69ca3e58 Krystian Garbaciak 2013-07-29  782  	/* Register all regulators declared in platform information */
69ca3e58 Krystian Garbaciak 2013-07-29  783  	n = 0;
69ca3e58 Krystian Garbaciak 2013-07-29  784  	id = 0;
69ca3e58 Krystian Garbaciak 2013-07-29  785  	while (n < regulators->n_regulators) {
69ca3e58 Krystian Garbaciak 2013-07-29  786  		/* Skip regulator IDs depending on merge mode configuration */
69ca3e58 Krystian Garbaciak 2013-07-29  787  		switch (id) {
69ca3e58 Krystian Garbaciak 2013-07-29  788  		case DA9063_ID_BCORE1:
69ca3e58 Krystian Garbaciak 2013-07-29  789  		case DA9063_ID_BCORE2:
69ca3e58 Krystian Garbaciak 2013-07-29  790  			if (bcores_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  791  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  792  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  793  			}
69ca3e58 Krystian Garbaciak 2013-07-29  794  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  795  		case DA9063_ID_BMEM:
69ca3e58 Krystian Garbaciak 2013-07-29  796  		case DA9063_ID_BIO:
69ca3e58 Krystian Garbaciak 2013-07-29  797  			if (bmem_bio_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  798  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  799  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  800  			}
69ca3e58 Krystian Garbaciak 2013-07-29  801  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  802  		case DA9063_ID_BCORES_MERGED:
69ca3e58 Krystian Garbaciak 2013-07-29  803  			if (!bcores_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  804  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  805  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  806  			}
69ca3e58 Krystian Garbaciak 2013-07-29  807  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  808  		case DA9063_ID_BMEM_BIO_MERGED:
69ca3e58 Krystian Garbaciak 2013-07-29  809  			if (!bmem_bio_merged) {
69ca3e58 Krystian Garbaciak 2013-07-29  810  				id++;
69ca3e58 Krystian Garbaciak 2013-07-29  811  				continue;
69ca3e58 Krystian Garbaciak 2013-07-29  812  			}
69ca3e58 Krystian Garbaciak 2013-07-29  813  			break;
69ca3e58 Krystian Garbaciak 2013-07-29  814  		}
69ca3e58 Krystian Garbaciak 2013-07-29  815  
69ca3e58 Krystian Garbaciak 2013-07-29  816  		/* Initialise regulator structure */
69ca3e58 Krystian Garbaciak 2013-07-29  817  		regl = &regulators->regulator[n];
69ca3e58 Krystian Garbaciak 2013-07-29  818  		regl->hw = da9063;
69ca3e58 Krystian Garbaciak 2013-07-29  819  		regl->info = &model->regulator_info[id];
69ca3e58 Krystian Garbaciak 2013-07-29  820  		regl->desc = regl->info->desc;
69ca3e58 Krystian Garbaciak 2013-07-29  821  		regl->desc.type = REGULATOR_VOLTAGE;
69ca3e58 Krystian Garbaciak 2013-07-29  822  		regl->desc.owner = THIS_MODULE;
69ca3e58 Krystian Garbaciak 2013-07-29  823  
69ca3e58 Krystian Garbaciak 2013-07-29  824  		if (regl->info->mode.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  825  			regl->mode = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  826  					da9063->regmap, regl->info->mode);
69ca3e58 Krystian Garbaciak 2013-07-29  827  		if (regl->info->suspend.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  828  			regl->suspend = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  829  					da9063->regmap, regl->info->suspend);
69ca3e58 Krystian Garbaciak 2013-07-29  830  		if (regl->info->sleep.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  831  			regl->sleep = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  832  					da9063->regmap, regl->info->sleep);
69ca3e58 Krystian Garbaciak 2013-07-29  833  		if (regl->info->suspend_sleep.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  834  			regl->suspend_sleep = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  835  					da9063->regmap, regl->info->suspend_sleep);
69ca3e58 Krystian Garbaciak 2013-07-29  836  		if (regl->info->ilimit.reg)
69ca3e58 Krystian Garbaciak 2013-07-29  837  			regl->ilimit = devm_regmap_field_alloc(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  838  					da9063->regmap, regl->info->ilimit);
69ca3e58 Krystian Garbaciak 2013-07-29  839  
69ca3e58 Krystian Garbaciak 2013-07-29  840  		/* Register regulator */
69ca3e58 Krystian Garbaciak 2013-07-29  841  		memset(&config, 0, sizeof(config));
69ca3e58 Krystian Garbaciak 2013-07-29  842  		config.dev = &pdev->dev;
69ca3e58 Krystian Garbaciak 2013-07-29  843  		config.init_data = da9063_get_regulator_initdata(regl_pdata, id);
69ca3e58 Krystian Garbaciak 2013-07-29  844  		config.driver_data = regl;
69ca3e58 Krystian Garbaciak 2013-07-29  845  		if (da9063_reg_matches)
69ca3e58 Krystian Garbaciak 2013-07-29  846  			config.of_node = da9063_reg_matches[id].of_node;
69ca3e58 Krystian Garbaciak 2013-07-29  847  		config.regmap = da9063->regmap;
e97bba91 Jingoo Han         2013-09-30  848  		regl->rdev = devm_regulator_register(&pdev->dev, &regl->desc,
e97bba91 Jingoo Han         2013-09-30  849  						     &config);
e515800b Axel Lin           2013-08-30  850  		if (IS_ERR(regl->rdev)) {
69ca3e58 Krystian Garbaciak 2013-07-29  851  			dev_err(&pdev->dev,
69ca3e58 Krystian Garbaciak 2013-07-29  852  				"Failed to register %s regulator\n",
69ca3e58 Krystian Garbaciak 2013-07-29  853  				regl->desc.name);
e97bba91 Jingoo Han         2013-09-30  854  			return PTR_ERR(regl->rdev);
69ca3e58 Krystian Garbaciak 2013-07-29  855  		}
69ca3e58 Krystian Garbaciak 2013-07-29  856  		id++;
69ca3e58 Krystian Garbaciak 2013-07-29  857  		n++;
69ca3e58 Krystian Garbaciak 2013-07-29  858  	}
69ca3e58 Krystian Garbaciak 2013-07-29  859  
69ca3e58 Krystian Garbaciak 2013-07-29  860  	/* LDOs overcurrent event support */
69ca3e58 Krystian Garbaciak 2013-07-29  861  	irq = platform_get_irq_byname(pdev, "LDO_LIM");
69ca3e58 Krystian Garbaciak 2013-07-29  862  	if (irq < 0) {
69ca3e58 Krystian Garbaciak 2013-07-29  863  		dev_err(&pdev->dev, "Failed to get IRQ.\n");
e97bba91 Jingoo Han         2013-09-30  864  		return irq;
69ca3e58 Krystian Garbaciak 2013-07-29  865  	}
69ca3e58 Krystian Garbaciak 2013-07-29  866  
d87aef91 Axel Lin           2015-05-31  867  	ret = devm_request_threaded_irq(&pdev->dev, irq,
69ca3e58 Krystian Garbaciak 2013-07-29  868  				NULL, da9063_ldo_lim_event,
69ca3e58 Krystian Garbaciak 2013-07-29  869  				IRQF_TRIGGER_LOW | IRQF_ONESHOT,
69ca3e58 Krystian Garbaciak 2013-07-29  870  				"LDO_LIM", regulators);
69ca3e58 Krystian Garbaciak 2013-07-29  871  	if (ret) {
d87aef91 Axel Lin           2015-05-31  872  		dev_err(&pdev->dev, "Failed to request LDO_LIM IRQ.\n");
d87aef91 Axel Lin           2015-05-31  873  		return ret;
69ca3e58 Krystian Garbaciak 2013-07-29  874  	}
69ca3e58 Krystian Garbaciak 2013-07-29  875  
69ca3e58 Krystian Garbaciak 2013-07-29  876  	return 0;
69ca3e58 Krystian Garbaciak 2013-07-29  877  }
69ca3e58 Krystian Garbaciak 2013-07-29  878  

:::::: The code at line 749 was first introduced by commit
:::::: 69ca3e58d17854f8fa72d85aea6bf4614ad25a56 regulator: da9063: Add Dialog DA9063 voltage regulators support.

:::::: TO: Krystian Garbaciak <krystian.garbaciak@diasemi.com>
:::::: CC: Mark Brown <broonie@linaro.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
index c54777cc2f12..ded59990f18c 100644
--- a/drivers/mfd/da9063-core.c
+++ b/drivers/mfd/da9063-core.c
@@ -215,7 +215,6 @@  int da9063_device_init(struct da9063 *da9063, unsigned int irq)
 		return -ENODEV;
 	}
 
-	da9063->model = model;
 	da9063->variant_code = variant_code;
 
 	ret = da9063_irq_init(da9063);
diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
index d1fe88777e3f..6fe9c3464b41 100644
--- a/drivers/mfd/da9063-i2c.c
+++ b/drivers/mfd/da9063-i2c.c
@@ -146,7 +146,7 @@  static const struct of_device_id da9063_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, da9063_dt_ids);
 static int da9063_i2c_probe(struct i2c_client *i2c,
-	const struct i2c_device_id *id)
+			    const struct i2c_device_id *id)
 {
 	struct da9063 *da9063;
 	int ret;
@@ -158,6 +158,7 @@  static int da9063_i2c_probe(struct i2c_client *i2c,
 	i2c_set_clientdata(i2c, da9063);
 	da9063->dev = &i2c->dev;
 	da9063->chip_irq = i2c->irq;
+	da9063->type = id->driver_data;
 
 	if (da9063->variant_code == PMIC_DA9063_AD) {
 		da9063_regmap_config.rd_table = &da9063_ad_readable_table;
@@ -181,7 +182,7 @@  static int da9063_i2c_probe(struct i2c_client *i2c,
 }
 
 static const struct i2c_device_id da9063_i2c_id[] = {
-	{ "da9063", PMIC_CHIP_ID_DA9063 },
+	{ "da9063", PMIC_TYPE_DA9063 },
 	{},
 };
 MODULE_DEVICE_TABLE(i2c, da9063_i2c_id);
diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c
index 87c884ae0064..eeb0d431dda1 100644
--- a/drivers/regulator/da9063-regulator.c
+++ b/drivers/regulator/da9063-regulator.c
@@ -98,7 +98,7 @@  struct da9063_regulator_info {
 struct da9063_dev_model {
 	const struct da9063_regulator_info	*regulator_info;
 	unsigned				n_regulators;
-	unsigned				dev_model;
+	enum da9063_type			type;
 };
 
 /* Single regulator settings */
@@ -585,7 +585,7 @@  static struct da9063_dev_model regulators_models[] = {
 	{
 		.regulator_info = da9063_regulator_info,
 		.n_regulators = ARRAY_SIZE(da9063_regulator_info),
-		.dev_model = PMIC_CHIP_ID_DA9063,
+		.type = PMIC_TYPE_DA9063,
 	},
 	{ }
 };
@@ -741,7 +741,7 @@  static int da9063_regulator_probe(struct platform_device *pdev)
 
 	/* Find regulators set for particular device model */
 	for (model = regulators_models; model->regulator_info; model++) {
-		if (model->dev_model == da9063->model)
+		if (model->type == da9063->type)
 			break;
 	}
 	if (!model->regulator_info) {
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h
index e015b065db7e..9e36097adc42 100644
--- a/include/linux/mfd/da9063/core.h
+++ b/include/linux/mfd/da9063/core.h
@@ -31,6 +31,10 @@ 
 
 #define PMIC_CHIP_ID_DA9063		0x61
 
+enum da9063_type {
+	PMIC_TYPE_DA9063 = 0,
+};
+
 enum da9063_variant_codes {
 	PMIC_DA9063_AD = 0x3,
 	PMIC_DA9063_BB = 0x5,
@@ -73,7 +77,7 @@  enum da9063_irqs {
 struct da9063 {
 	/* Device */
 	struct device	*dev;
-	unsigned short	model;
+	enum da9063_type type;
 	unsigned char	variant_code;
 	unsigned int	flags;