Skip to content

Commit

Permalink
nvmem: mxs-ocotp: use devm_nvmem_register()
Browse files Browse the repository at this point in the history
Use the resource managed variant of nvmem_register();

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
brgl authored and gregkh committed Sep 28, 2018
1 parent 226014d commit 7d9f9f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nvmem/mxs-ocotp.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static int mxs_ocotp_probe(struct platform_device *pdev)
ocotp_config.size = data->size;
ocotp_config.priv = otp;
ocotp_config.dev = dev;
otp->nvmem = nvmem_register(&ocotp_config);
otp->nvmem = devm_nvmem_register(dev, &ocotp_config);
if (IS_ERR(otp->nvmem)) {
ret = PTR_ERR(otp->nvmem);
goto err_clk;
Expand All @@ -199,7 +199,7 @@ static int mxs_ocotp_remove(struct platform_device *pdev)

clk_unprepare(otp->clk);

return nvmem_unregister(otp->nvmem);
return 0;
}

static struct platform_driver mxs_ocotp_driver = {
Expand Down

0 comments on commit 7d9f9f2

Please sign in to comment.