mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	rtc: pic32: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
		
							parent
							
								
									7d1e5bfe17
								
							
						
					
					
						commit
						6515e23b9f
					
				
					 1 changed files with 8 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -348,13 +348,15 @@ static int pic32_rtc_probe(struct platform_device *pdev)
 | 
			
		|||
 | 
			
		||||
	device_init_wakeup(&pdev->dev, 1);
 | 
			
		||||
 | 
			
		||||
	pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
 | 
			
		||||
						 &pic32_rtcops,
 | 
			
		||||
						 THIS_MODULE);
 | 
			
		||||
	if (IS_ERR(pdata->rtc)) {
 | 
			
		||||
		ret = PTR_ERR(pdata->rtc);
 | 
			
		||||
	pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
 | 
			
		||||
	if (IS_ERR(pdata->rtc))
 | 
			
		||||
		return PTR_ERR(pdata->rtc);
 | 
			
		||||
 | 
			
		||||
	pdata->rtc->ops = &pic32_rtcops;
 | 
			
		||||
 | 
			
		||||
	ret = rtc_register_device(pdata->rtc);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		goto err_nortc;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	pdata->rtc->max_user_freq = 128;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue