All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.
@ 2021-02-08 13:23 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-02-08 13:23 UTC (permalink / raw)
  To: kbuild, Claudiu.Beznea
  Cc: lkp, kbuild-all, linux-kernel, Sebastian Reichel, Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: b7967b7919f0e3787d6e23424b5ad367fbb937e2 power: reset: at91-reset: convert reset in pointer to struct at91_reset
config: arm-randconfig-m031-20210206 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.

vim +260 drivers/power/reset/at91-reset.c

6e64180a7c0219 Alexandre Belloni            2015-08-11  209  static int __init at91_reset_probe(struct platform_device *pdev)
ecfe64d8c55f8f Maxime Ripard                2014-07-02  210  {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  211  	const struct of_device_id *match;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  212  	struct device_node *np;
eacd8d09db7f45 Alexandre Belloni            2015-08-11  213  	int ret, idx = 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  214  
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  215  	reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  216  	if (!reset)
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  217  		return -ENOMEM;
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  218  
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  219  	reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  220  	if (!reset->rstc_base) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  221  		dev_err(&pdev->dev, "Could not map reset controller address\n");
ecfe64d8c55f8f Maxime Ripard                2014-07-02  222  		return -ENODEV;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  223  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  224  
1ae25d626cfe7e Josh Wu                      2015-07-20  225  	if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) {
1ae25d626cfe7e Josh Wu                      2015-07-20  226  		/* we need to shutdown the ddr controller, so get ramc base */
ecfe64d8c55f8f Maxime Ripard                2014-07-02  227  		for_each_matching_node(np, at91_ramc_of_match) {
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  228  			reset->ramc_base[idx] = of_iomap(np, 0);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  229  			if (!reset->ramc_base[idx]) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  230  				dev_err(&pdev->dev, "Could not map ram controller address\n");
c4c0edfbf875a5 Julia Lawall                 2015-11-18  231  				of_node_put(np);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  232  				return -ENODEV;

These error paths should probably unmap "reset->rstc_base"?

ecfe64d8c55f8f Maxime Ripard                2014-07-02  233  			}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  234  			idx++;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  235  		}
1ae25d626cfe7e Josh Wu                      2015-07-20  236  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  237  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  238  	match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  239  	reset->nb.notifier_call = match->data;
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  240  	reset->nb.priority = 192;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  241  
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  242  	reset->sclk = devm_clk_get(&pdev->dev, NULL);
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  243  	if (IS_ERR(reset->sclk))
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  244  		return PTR_ERR(reset->sclk);

Etc.  These should probably unmap reset->ramc_base[].

2b2c6148fe8510 Alexandre Belloni            2015-08-11  245  
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  246  	ret = clk_prepare_enable(reset->sclk);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  247  	if (ret) {
2b2c6148fe8510 Alexandre Belloni            2015-08-11  248  		dev_err(&pdev->dev, "Could not enable slow clock\n");
2b2c6148fe8510 Alexandre Belloni            2015-08-11  249  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  250  	}
2b2c6148fe8510 Alexandre Belloni            2015-08-11  251  
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  252  	ret = register_restart_handler(&reset->nb);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  253  	if (ret) {
b7967b7919f0e3 Claudiu.Beznea@microchip.com 2020-01-21  254  		clk_disable_unprepare(reset->sclk);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  255  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  256  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  257  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  258  	at91_reset_status(pdev);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  259  
ecfe64d8c55f8f Maxime Ripard                2014-07-02 @260  	return 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  261  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23054 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.
@ 2021-02-08 13:23 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-02-08 13:23 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5590 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: b7967b7919f0e3787d6e23424b5ad367fbb937e2 power: reset: at91-reset: convert reset in pointer to struct at91_reset
config: arm-randconfig-m031-20210206 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.

vim +260 drivers/power/reset/at91-reset.c

6e64180a7c0219 Alexandre Belloni            2015-08-11  209  static int __init at91_reset_probe(struct platform_device *pdev)
ecfe64d8c55f8f Maxime Ripard                2014-07-02  210  {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  211  	const struct of_device_id *match;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  212  	struct device_node *np;
eacd8d09db7f45 Alexandre Belloni            2015-08-11  213  	int ret, idx = 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  214  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  215  	reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  216  	if (!reset)
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  217  		return -ENOMEM;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  218  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  219  	reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  220  	if (!reset->rstc_base) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  221  		dev_err(&pdev->dev, "Could not map reset controller address\n");
ecfe64d8c55f8f Maxime Ripard                2014-07-02  222  		return -ENODEV;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  223  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  224  
1ae25d626cfe7e Josh Wu                      2015-07-20  225  	if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) {
1ae25d626cfe7e Josh Wu                      2015-07-20  226  		/* we need to shutdown the ddr controller, so get ramc base */
ecfe64d8c55f8f Maxime Ripard                2014-07-02  227  		for_each_matching_node(np, at91_ramc_of_match) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  228  			reset->ramc_base[idx] = of_iomap(np, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  229  			if (!reset->ramc_base[idx]) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  230  				dev_err(&pdev->dev, "Could not map ram controller address\n");
c4c0edfbf875a5 Julia Lawall                 2015-11-18  231  				of_node_put(np);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  232  				return -ENODEV;

These error paths should probably unmap "reset->rstc_base"?

ecfe64d8c55f8f Maxime Ripard                2014-07-02  233  			}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  234  			idx++;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  235  		}
1ae25d626cfe7e Josh Wu                      2015-07-20  236  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  237  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  238  	match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  239  	reset->nb.notifier_call = match->data;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  240  	reset->nb.priority = 192;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  241  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  242  	reset->sclk = devm_clk_get(&pdev->dev, NULL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  243  	if (IS_ERR(reset->sclk))
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  244  		return PTR_ERR(reset->sclk);

Etc.  These should probably unmap reset->ramc_base[].

2b2c6148fe8510 Alexandre Belloni            2015-08-11  245  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  246  	ret = clk_prepare_enable(reset->sclk);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  247  	if (ret) {
2b2c6148fe8510 Alexandre Belloni            2015-08-11  248  		dev_err(&pdev->dev, "Could not enable slow clock\n");
2b2c6148fe8510 Alexandre Belloni            2015-08-11  249  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  250  	}
2b2c6148fe8510 Alexandre Belloni            2015-08-11  251  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  252  	ret = register_restart_handler(&reset->nb);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  253  	if (ret) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  254  		clk_disable_unprepare(reset->sclk);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  255  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  256  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  257  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  258  	at91_reset_status(pdev);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  259  
ecfe64d8c55f8f Maxime Ripard                2014-07-02 @260  	return 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  261  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23054 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.
@ 2021-02-08 13:23 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-02-08 13:23 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5590 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: b7967b7919f0e3787d6e23424b5ad367fbb937e2 power: reset: at91-reset: convert reset in pointer to struct at91_reset
config: arm-randconfig-m031-20210206 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.

vim +260 drivers/power/reset/at91-reset.c

6e64180a7c0219 Alexandre Belloni            2015-08-11  209  static int __init at91_reset_probe(struct platform_device *pdev)
ecfe64d8c55f8f Maxime Ripard                2014-07-02  210  {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  211  	const struct of_device_id *match;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  212  	struct device_node *np;
eacd8d09db7f45 Alexandre Belloni            2015-08-11  213  	int ret, idx = 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  214  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  215  	reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  216  	if (!reset)
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  217  		return -ENOMEM;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  218  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  219  	reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  220  	if (!reset->rstc_base) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  221  		dev_err(&pdev->dev, "Could not map reset controller address\n");
ecfe64d8c55f8f Maxime Ripard                2014-07-02  222  		return -ENODEV;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  223  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  224  
1ae25d626cfe7e Josh Wu                      2015-07-20  225  	if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) {
1ae25d626cfe7e Josh Wu                      2015-07-20  226  		/* we need to shutdown the ddr controller, so get ramc base */
ecfe64d8c55f8f Maxime Ripard                2014-07-02  227  		for_each_matching_node(np, at91_ramc_of_match) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  228  			reset->ramc_base[idx] = of_iomap(np, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  229  			if (!reset->ramc_base[idx]) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  230  				dev_err(&pdev->dev, "Could not map ram controller address\n");
c4c0edfbf875a5 Julia Lawall                 2015-11-18  231  				of_node_put(np);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  232  				return -ENODEV;

These error paths should probably unmap "reset->rstc_base"?

ecfe64d8c55f8f Maxime Ripard                2014-07-02  233  			}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  234  			idx++;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  235  		}
1ae25d626cfe7e Josh Wu                      2015-07-20  236  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  237  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  238  	match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  239  	reset->nb.notifier_call = match->data;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  240  	reset->nb.priority = 192;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  241  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  242  	reset->sclk = devm_clk_get(&pdev->dev, NULL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  243  	if (IS_ERR(reset->sclk))
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  244  		return PTR_ERR(reset->sclk);

Etc.  These should probably unmap reset->ramc_base[].

2b2c6148fe8510 Alexandre Belloni            2015-08-11  245  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  246  	ret = clk_prepare_enable(reset->sclk);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  247  	if (ret) {
2b2c6148fe8510 Alexandre Belloni            2015-08-11  248  		dev_err(&pdev->dev, "Could not enable slow clock\n");
2b2c6148fe8510 Alexandre Belloni            2015-08-11  249  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  250  	}
2b2c6148fe8510 Alexandre Belloni            2015-08-11  251  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  252  	ret = register_restart_handler(&reset->nb);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  253  	if (ret) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  254  		clk_disable_unprepare(reset->sclk);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  255  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  256  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  257  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  258  	at91_reset_status(pdev);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  259  
ecfe64d8c55f8f Maxime Ripard                2014-07-02 @260  	return 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  261  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23054 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.
@ 2021-02-06  7:35 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2021-02-06  7:35 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6183 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Claudiu.Beznea" <Claudiu.Beznea@microchip.com>
CC: Sebastian Reichel <sebastian.reichel@collabora.com>
CC: Claudiu Beznea <claudiu.beznea@microchip.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   61556703b610a104de324e4f061dc6cf7b218b46
commit: b7967b7919f0e3787d6e23424b5ad367fbb937e2 power: reset: at91-reset: convert reset in pointer to struct at91_reset
date:   11 months ago
:::::: branch date: 3 days ago
:::::: commit date: 11 months ago
config: arm-randconfig-m031-20210206 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244.

vim +260 drivers/power/reset/at91-reset.c

ecfe64d8c55f8f Maxime Ripard                2014-07-02  208  
6e64180a7c0219 Alexandre Belloni            2015-08-11  209  static int __init at91_reset_probe(struct platform_device *pdev)
ecfe64d8c55f8f Maxime Ripard                2014-07-02  210  {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  211  	const struct of_device_id *match;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  212  	struct device_node *np;
eacd8d09db7f45 Alexandre Belloni            2015-08-11  213  	int ret, idx = 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  214  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  215  	reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  216  	if (!reset)
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  217  		return -ENOMEM;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  218  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  219  	reset->rstc_base = of_iomap(pdev->dev.of_node, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  220  	if (!reset->rstc_base) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  221  		dev_err(&pdev->dev, "Could not map reset controller address\n");
ecfe64d8c55f8f Maxime Ripard                2014-07-02  222  		return -ENODEV;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  223  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  224  
1ae25d626cfe7e Josh Wu                      2015-07-20  225  	if (!of_device_is_compatible(pdev->dev.of_node, "atmel,sama5d3-rstc")) {
1ae25d626cfe7e Josh Wu                      2015-07-20  226  		/* we need to shutdown the ddr controller, so get ramc base */
ecfe64d8c55f8f Maxime Ripard                2014-07-02  227  		for_each_matching_node(np, at91_ramc_of_match) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  228  			reset->ramc_base[idx] = of_iomap(np, 0);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  229  			if (!reset->ramc_base[idx]) {
ecfe64d8c55f8f Maxime Ripard                2014-07-02  230  				dev_err(&pdev->dev, "Could not map ram controller address\n");
c4c0edfbf875a5 Julia Lawall                 2015-11-18  231  				of_node_put(np);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  232  				return -ENODEV;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  233  			}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  234  			idx++;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  235  		}
1ae25d626cfe7e Josh Wu                      2015-07-20  236  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  237  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  238  	match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  239  	reset->nb.notifier_call = match->data;
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  240  	reset->nb.priority = 192;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  241  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  242  	reset->sclk = devm_clk_get(&pdev->dev, NULL);
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  243  	if (IS_ERR(reset->sclk))
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  244  		return PTR_ERR(reset->sclk);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  245  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  246  	ret = clk_prepare_enable(reset->sclk);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  247  	if (ret) {
2b2c6148fe8510 Alexandre Belloni            2015-08-11  248  		dev_err(&pdev->dev, "Could not enable slow clock\n");
2b2c6148fe8510 Alexandre Belloni            2015-08-11  249  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  250  	}
2b2c6148fe8510 Alexandre Belloni            2015-08-11  251  
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  252  	ret = register_restart_handler(&reset->nb);
2b2c6148fe8510 Alexandre Belloni            2015-08-11  253  	if (ret) {
b7967b7919f0e3 Claudiu.Beznea(a)microchip.com 2020-01-21  254  		clk_disable_unprepare(reset->sclk);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  255  		return ret;
2b2c6148fe8510 Alexandre Belloni            2015-08-11  256  	}
ecfe64d8c55f8f Maxime Ripard                2014-07-02  257  
ecfe64d8c55f8f Maxime Ripard                2014-07-02  258  	at91_reset_status(pdev);
ecfe64d8c55f8f Maxime Ripard                2014-07-02  259  
ecfe64d8c55f8f Maxime Ripard                2014-07-02 @260  	return 0;
ecfe64d8c55f8f Maxime Ripard                2014-07-02  261  }
ecfe64d8c55f8f Maxime Ripard                2014-07-02  262  

:::::: The code at line 260 was first introduced by commit
:::::: ecfe64d8c55f8f210a609cd2eabfcc03f03672a9 power: reset: Add AT91 reset driver

:::::: TO: Maxime Ripard <maxime.ripard@free-electrons.com>
:::::: CC: Maxime Ripard <maxime.ripard@free-electrons.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23054 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-08 13:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 13:23 drivers/power/reset/at91-reset.c:260 at91_reset_probe() warn: 'reset->rstc_base' not released on lines: 244 Dan Carpenter
2021-02-08 13:23 ` Dan Carpenter
2021-02-08 13:23 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2021-02-06  7:35 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.