# \[PATCH v4 37/41\] fbdev: atyfb: Remove unused clock determination

- Subsystems: FRAMEBUFFER LAYER, THE REST
- Maintainers: Helge Deller, Linus Torvalds
- Status: SUPERSEDED (Superseded by v5 posted 2023-05-22)
- Superseded by v5 (posted 2023-05-22).
- Revision v4 (2 revisions archived).
- List: linux-fbdev
- 3 messages, 3 authors
- Page: https://ratatoskr.run/linux-fbdev/2023/05/2199059/t

## \[PATCH v4 37/41\] fbdev: atyfb: Remove unused clock determination

- From: Niklas Schnelle \<schnelle@linux.ibm.com\>
- Date: 2023-05-16 11:04:40 
- Message: https://ratatoskr.run/linux-fbdev/2023/05/2199059.md

```text
Just below the removed lines par->clk_wr_offset is hard coded to 3 so
there is no use in determining a different clock just to then ignore it
anyway. This also removes the only I/O port use remaining in the driver
allowing it to be built without CONFIG_HAS_IOPORT.

Link: https://lore.kernel.org/all/ZBx5aLo5h546BzBt@intel.com/
Suggested-by: Ville Syrjälä <redacted>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
---
Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so
      per-subsystem patches may be applied independently

 drivers/video/fbdev/aty/atyfb_base.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index b02e4e645035..cba2b113b28b 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3498,11 +3498,6 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
 	if (ret)
 		goto atyfb_setup_generic_fail;
 #endif
-	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
-		par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;
-	else
-		par->clk_wr_offset = aty_ld_8(CLOCK_CNTL, par) & 0x03U;
-
 	/* according to ATI, we should use clock 3 for acelerated mode */
 	par->clk_wr_offset = 3;
 
-- 
2.39.2

```

## Re: \[PATCH v4 37/41\] fbdev: atyfb: Remove unused clock determination

- From: Ville Syrjälä \<hidden\>
- Date: 2023-05-16 12:25:03 
- Message: https://ratatoskr.run/linux-fbdev/2023/05/2199185.md

```text
On Tue, May 16, 2023 at 01:00:33PM +0200, Niklas Schnelle wrote:
> Just below the removed lines par->clk_wr_offset is hard coded to 3 so
> there is no use in determining a different clock just to then ignore it
> anyway. This also removes the only I/O port use remaining in the driver
> allowing it to be built without CONFIG_HAS_IOPORT.
> 
> Link: https://lore.kernel.org/all/ZBx5aLo5h546BzBt@intel.com/
> Suggested-by: Ville Syrjälä <redacted>
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>

Reviewed-by: Ville Syrjälä <redacted>

> ---
> Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so
>       per-subsystem patches may be applied independently
> 
>  drivers/video/fbdev/aty/atyfb_base.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
> index b02e4e645035..cba2b113b28b 100644
> --- a/drivers/video/fbdev/aty/atyfb_base.c
> +++ b/drivers/video/fbdev/aty/atyfb_base.c
> @@ -3498,11 +3498,6 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
>  	if (ret)
>  		goto atyfb_setup_generic_fail;
>  #endif
> -	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
> -		par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;
> -	else
> -		par->clk_wr_offset = aty_ld_8(CLOCK_CNTL, par) & 0x03U;
> -
>  	/* according to ATI, we should use clock 3 for acelerated mode */
>  	par->clk_wr_offset = 3;
>  
> -- 
> 2.39.2

-- 
Ville Syrjälä
Intel
```

## Re: \[PATCH v4 37/41\] fbdev: atyfb: Remove unused clock determination

- From: Helge Deller \<deller@gmx.de\>
- Date: 2023-05-19 14:50:12 
- Message: https://ratatoskr.run/linux-fbdev/2023/05/2203521.md

```text
On 5/16/23 14:24, Ville Syrjälä wrote:
> On Tue, May 16, 2023 at 01:00:33PM +0200, Niklas Schnelle wrote:
>> Just below the removed lines par->clk_wr_offset is hard coded to 3 so
>> there is no use in determining a different clock just to then ignore it
>> anyway. This also removes the only I/O port use remaining in the driver
>> allowing it to be built without CONFIG_HAS_IOPORT.
>>
>> Link: https://lore.kernel.org/all/ZBx5aLo5h546BzBt@intel.com/
>> Suggested-by: Ville Syrjälä <redacted>
>> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
>
> Reviewed-by: Ville Syrjälä <redacted>
>
>> ---
>> Note: The HAS_IOPORT Kconfig option was added in v6.4-rc1 so
>>        per-subsystem patches may be applied independently

applied this patch to fbdev git tree.

Thanks!

Helge

>>
>>   drivers/video/fbdev/aty/atyfb_base.c | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
>> index b02e4e645035..cba2b113b28b 100644
>> --- a/drivers/video/fbdev/aty/atyfb_base.c
>> +++ b/drivers/video/fbdev/aty/atyfb_base.c
>> @@ -3498,11 +3498,6 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info,
>>   	if (ret)
>>   		goto atyfb_setup_generic_fail;
>>   #endif
>> -	if (!(aty_ld_le32(CRTC_GEN_CNTL, par) & CRTC_EXT_DISP_EN))
>> -		par->clk_wr_offset = (inb(R_GENMO) & 0x0CU) >> 2;
>> -	else
>> -		par->clk_wr_offset = aty_ld_8(CLOCK_CNTL, par) & 0x03U;
>> -
>>   	/* according to ATI, we should use clock 3 for acelerated mode */
>>   	par->clk_wr_offset = 3;
>>
>> --
>> 2.39.2
>

```
