diff options
Diffstat (limited to 'drivers/nvmem/lpc18xx_eeprom.c')
| -rw-r--r-- | drivers/nvmem/lpc18xx_eeprom.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/nvmem/lpc18xx_eeprom.c b/drivers/nvmem/lpc18xx_eeprom.c index c81ae4c6da74..aa43f5f612f9 100644 --- a/drivers/nvmem/lpc18xx_eeprom.c +++ b/drivers/nvmem/lpc18xx_eeprom.c @@ -1,11 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * NXP LPC18xx/LPC43xx EEPROM memory NVMEM driver * * Copyright (c) 2015 Ariel D'Alessandro <ariel@vanguardiasur.com> - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published by - * the Free Software Foundation. */ #include <linux/clk.h> @@ -14,6 +11,7 @@ #include <linux/err.h> #include <linux/io.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/nvmem-provider.h> #include <linux/platform_device.h> #include <linux/reset.h> @@ -159,7 +157,6 @@ static struct nvmem_config lpc18xx_nvmem_config = { .word_size = 4, .reg_read = lpc18xx_eeprom_read, .reg_write = lpc18xx_eeprom_gather_write, - .owner = THIS_MODULE, }; static int lpc18xx_eeprom_probe(struct platform_device *pdev) @@ -197,7 +194,7 @@ static int lpc18xx_eeprom_probe(struct platform_device *pdev) return ret; } - rst = devm_reset_control_get(dev, NULL); + rst = devm_reset_control_get_exclusive(dev, NULL); if (IS_ERR(rst)) { dev_err(dev, "failed to get reset: %ld\n", PTR_ERR(rst)); ret = PTR_ERR(rst); @@ -236,7 +233,7 @@ static int lpc18xx_eeprom_probe(struct platform_device *pdev) lpc18xx_nvmem_config.dev = dev; lpc18xx_nvmem_config.priv = eeprom; - eeprom->nvmem = nvmem_register(&lpc18xx_nvmem_config); + eeprom->nvmem = devm_nvmem_register(dev, &lpc18xx_nvmem_config); if (IS_ERR(eeprom->nvmem)) { ret = PTR_ERR(eeprom->nvmem); goto err_clk; @@ -252,18 +249,11 @@ err_clk: return ret; } -static int lpc18xx_eeprom_remove(struct platform_device *pdev) +static void lpc18xx_eeprom_remove(struct platform_device *pdev) { struct lpc18xx_eeprom_dev *eeprom = platform_get_drvdata(pdev); - int ret; - - ret = nvmem_unregister(eeprom->nvmem); - if (ret < 0) - return ret; clk_disable_unprepare(eeprom->clk); - - return 0; } static const struct of_device_id lpc18xx_eeprom_of_match[] = { |
