rtc-pcf2127.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) | rtc-pcf2127.c (e788771cacafa4ae5c4dbfc404cd3579e77a0816) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * An I2C and SPI driver for the NXP PCF2127/29 RTC 4 * Copyright 2013 Til-Technologies 5 * 6 * Author: Renaud Cerrato <r.cerrato@til-technologies.fr> 7 * 8 * based on the other drivers in this same directory. --- 223 unchanged lines hidden (view full) --- 232 pcf2127 = devm_kzalloc(dev, sizeof(*pcf2127), GFP_KERNEL); 233 if (!pcf2127) 234 return -ENOMEM; 235 236 pcf2127->regmap = regmap; 237 238 dev_set_drvdata(dev, pcf2127); 239 | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * An I2C and SPI driver for the NXP PCF2127/29 RTC 4 * Copyright 2013 Til-Technologies 5 * 6 * Author: Renaud Cerrato <r.cerrato@til-technologies.fr> 7 * 8 * based on the other drivers in this same directory. --- 223 unchanged lines hidden (view full) --- 232 pcf2127 = devm_kzalloc(dev, sizeof(*pcf2127), GFP_KERNEL); 233 if (!pcf2127) 234 return -ENOMEM; 235 236 pcf2127->regmap = regmap; 237 238 dev_set_drvdata(dev, pcf2127); 239 |
240 pcf2127->rtc = devm_rtc_device_register(dev, name, &pcf2127_rtc_ops, 241 THIS_MODULE); | 240 pcf2127->rtc = devm_rtc_allocate_device(dev); |
242 if (IS_ERR(pcf2127->rtc)) 243 return PTR_ERR(pcf2127->rtc); 244 | 241 if (IS_ERR(pcf2127->rtc)) 242 return PTR_ERR(pcf2127->rtc); 243 |
244 pcf2127->rtc->ops = &pcf2127_rtc_ops; 245 |
|
245 if (has_nvmem) { 246 struct nvmem_config nvmem_cfg = { 247 .priv = pcf2127, 248 .reg_read = pcf2127_nvmem_read, 249 .reg_write = pcf2127_nvmem_write, 250 .size = 512, 251 }; 252 253 ret = rtc_nvmem_register(pcf2127->rtc, &nvmem_cfg); 254 } 255 | 246 if (has_nvmem) { 247 struct nvmem_config nvmem_cfg = { 248 .priv = pcf2127, 249 .reg_read = pcf2127_nvmem_read, 250 .reg_write = pcf2127_nvmem_write, 251 .size = 512, 252 }; 253 254 ret = rtc_nvmem_register(pcf2127->rtc, &nvmem_cfg); 255 } 256 |
256 return ret; | 257 return rtc_register_device(pcf2127->rtc); |
257} 258 259#ifdef CONFIG_OF 260static const struct of_device_id pcf2127_of_match[] = { 261 { .compatible = "nxp,pcf2127" }, 262 { .compatible = "nxp,pcf2129" }, 263 {} 264}; --- 238 unchanged lines hidden --- | 258} 259 260#ifdef CONFIG_OF 261static const struct of_device_id pcf2127_of_match[] = { 262 { .compatible = "nxp,pcf2127" }, 263 { .compatible = "nxp,pcf2129" }, 264 {} 265}; --- 238 unchanged lines hidden --- |