Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17eb18d6 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Greg Kroah-Hartman
Browse files

nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset



All nvmem drivers are supposed to set the owner field of struct
nvmem_config, but this matches nvmem->dev->driver->owner.

As far as I see in drivers/nvmem/ directory, all the drivers are
the case.  So, make nvmem_register() set the nvmem's owner to the
associated driver's owner unless nvmem_config sets otherwise.

Remove .owner settings in the drivers that are now redundant.

Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ec3672b8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -232,7 +232,6 @@ static struct nvmem_config bcm_otpc_nvmem_config = {
	.read_only = false,
	.word_size = 4,
	.stride = 4,
	.owner = THIS_MODULE,
	.reg_read = bcm_otpc_read,
	.reg_write = bcm_otpc_write,
};
+2 −0
Original line number Diff line number Diff line
@@ -462,6 +462,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)

	nvmem->id = rval;
	nvmem->owner = config->owner;
	if (!nvmem->owner && config->dev->driver)
		nvmem->owner = config->dev->driver->owner;
	nvmem->stride = config->stride;
	nvmem->word_size = config->word_size;
	nvmem->size = config->size;
+0 −1
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@ static int imx_iim_probe(struct platform_device *pdev)
	cfg.read_only = true,
	cfg.word_size = 1,
	cfg.stride = 1,
	cfg.owner = THIS_MODULE,
	cfg.reg_read = imx_iim_read,
	cfg.dev = dev;
	cfg.size = drvdata->nregs;
+0 −1
Original line number Diff line number Diff line
@@ -303,7 +303,6 @@ static struct nvmem_config imx_ocotp_nvmem_config = {
	.read_only = false,
	.word_size = 4,
	.stride = 4,
	.owner = THIS_MODULE,
	.reg_read = imx_ocotp_read,
	.reg_write = imx_ocotp_write,
};
+0 −1
Original line number Diff line number Diff line
@@ -159,7 +159,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)
Loading