@@ -678,7 +678,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
678678 int err , errirq , i , irq_cnt = 0 , irqres = 0 , irq_cap = 0 ;
679679 struct sh_dmae_device * shdev ;
680680 struct dma_device * dma_dev ;
681- struct resource * chan , * dmars , * errirq_res , * chanirq_res ;
681+ struct resource * dmars , * errirq_res , * chanirq_res ;
682682
683683 if (pdev -> dev .of_node )
684684 pdata = of_device_get_match_data (& pdev -> dev );
@@ -689,7 +689,6 @@ static int sh_dmae_probe(struct platform_device *pdev)
689689 if (!pdata || !pdata -> channel_num )
690690 return - ENODEV ;
691691
692- chan = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
693692 /* DMARS area is optional */
694693 dmars = platform_get_resource (pdev , IORESOURCE_MEM , 1 );
695694 /*
@@ -709,7 +708,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
709708 * requested with the IRQF_SHARED flag
710709 */
711710 errirq_res = platform_get_resource (pdev , IORESOURCE_IRQ , 0 );
712- if (!chan || ! errirq_res )
711+ if (!errirq_res )
713712 return - ENODEV ;
714713
715714 shdev = devm_kzalloc (& pdev -> dev , sizeof (struct sh_dmae_device ),
@@ -719,7 +718,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
719718
720719 dma_dev = & shdev -> shdma_dev .dma_dev ;
721720
722- shdev -> chan_reg = devm_ioremap_resource ( & pdev -> dev , chan );
721+ shdev -> chan_reg = devm_platform_ioremap_resource ( pdev , 0 );
723722 if (IS_ERR (shdev -> chan_reg ))
724723 return PTR_ERR (shdev -> chan_reg );
725724 if (dmars ) {
0 commit comments