Subject: Re: [PATCH v7 iwl-next 5/6] ice: Add timestamp ready bitmap for E830 products

From: Simon Horman <[email-masked]>
Date: Sat, 24 Aug 2024 14:32:23 +0100

On Tue, Aug 20, 2024 at 12:21:52PM +0200, Karol Kolacinski wrote:
> E830 PHY supports timestamp ready bitmap.
> Enable the bitmap by refactoring tx init function.
> 
> Reviewed-by: Przemek Kitszel <[email-masked]>
> Signed-off-by: Karol Kolacinski <[email-masked]>

...

> @@ -3344,20 +3327,13 @@ static int ice_ptp_init_port(struct ice_pf *pf, struct ice_ptp_port *ptp_port)
>  	mutex_init(&ptp_port->ps_lock);
>  
>  	switch (hw->mac_type) {
> -	case ICE_MAC_E810:
> -	case ICE_MAC_E830:
> -		return ice_ptp_init_tx_e810(pf, &ptp_port->tx);
>  	case ICE_MAC_GENERIC:
>  		kthread_init_delayed_work(&ptp_port->ov_work,
>  					  ice_ptp_wait_for_offsets);
> -
>  		return ice_ptp_init_tx_e82x(pf, &ptp_port->tx,
>  					    ptp_port->port_num);
> -	case ICE_MAC_GENERIC_3K_E825:
> -		return ice_ptp_init_tx_eth56g(pf, &ptp_port->tx,
> -					      ptp_port->port_num);
>  	default:
> -		return -ENODEV;
> +		return ice_ptp_init_tx(pf, &ptp_port->tx, ptp_port->port_num);
>  	}

I think it would be better to maintain default as an error case
for unknown mac_type values. (completely untested!)

	switch (hw->mac_type) {
	case ICE_MAC_E810:
	case ICE_MAC_E830:
	case ICE_MAC_GENERIC_3K_E825:
		return ice_ptp_init_tx(pf, &ptp_port->tx, ptp_port->port_num);
	case ICE_MAC_GENERIC:
		kthread_init_delayed_work(&ptp_port->ov_work,
					  ice_ptp_wait_for_offsets);
		return ice_ptp_init_tx_e82x(pf, &ptp_port->tx,
					    ptp_port->port_num);
	default:
		return -ENODEV;
	}

And update the Return: section in the Kernel doc accordingly.

>  }

...