diff mbox

[net-next,V2,17/23] ptp: stmmac: convert to the 64 bit get/set time methods.

Message ID 009374d77dee7633ab0ef1a5d95182b45aaa3f18.1426973658.git.richardcochran@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Richard Cochran March 21, 2015, 9:39 p.m. UTC
This device stores the number of seconds in a 32 bit register.  So
more work is needed on this driver before the year 2038 comes around.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Giuseppe CAVALLARO March 23, 2015, 3:35 p.m. UTC | #1
On 3/21/2015 10:39 PM, Richard Cochran wrote:
> This device stores the number of seconds in a 32 bit register.  So
> more work is needed on this driver before the year 2038 comes around.
>
> Compile tested only.

I cannot perform tests on my side, unfortunately. I have no setup at
this moment. Added Rayagond on copy too

Peppe

>
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> index c5ee79d8..172f318 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> @@ -105,7 +105,7 @@ static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
>    * Description: this function will read the current time from the
>    * hardware clock and store it in @ts.
>    */
> -static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
> +static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)
>   {
>   	struct stmmac_priv *priv =
>   	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
> @@ -135,7 +135,7 @@ static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
>    * hardware clock.
>    */
>   static int stmmac_set_time(struct ptp_clock_info *ptp,
> -			   const struct timespec *ts)
> +			   const struct timespec64 *ts)
>   {
>   	struct stmmac_priv *priv =
>   	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
> @@ -168,8 +168,8 @@ static struct ptp_clock_info stmmac_ptp_clock_ops = {
>   	.pps = 0,
>   	.adjfreq = stmmac_adjust_freq,
>   	.adjtime = stmmac_adjust_time,
> -	.gettime = stmmac_get_time,
> -	.settime = stmmac_set_time,
> +	.gettime64 = stmmac_get_time,
> +	.settime64 = stmmac_set_time,
>   	.enable = stmmac_enable,
>   };
>
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rayagond K March 31, 2015, 1:22 p.m. UTC | #2
Sorry, I too don't have setup now.

--
Rayagond

On Mon, Mar 23, 2015 at 9:05 PM, Giuseppe CAVALLARO
<peppe.cavallaro@st.com> wrote:
> On 3/21/2015 10:39 PM, Richard Cochran wrote:
>>
>> This device stores the number of seconds in a 32 bit register.  So
>> more work is needed on this driver before the year 2038 comes around.
>>
>> Compile tested only.
>
>
> I cannot perform tests on my side, unfortunately. I have no setup at
> this moment. Added Rayagond on copy too
>
> Peppe
>
>
>>
>> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
>> ---
>>   drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c |    8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> index c5ee79d8..172f318 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> @@ -105,7 +105,7 @@ static int stmmac_adjust_time(struct ptp_clock_info
>> *ptp, s64 delta)
>>    * Description: this function will read the current time from the
>>    * hardware clock and store it in @ts.
>>    */
>> -static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec
>> *ts)
>> +static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64
>> *ts)
>>   {
>>         struct stmmac_priv *priv =
>>             container_of(ptp, struct stmmac_priv, ptp_clock_ops);
>> @@ -135,7 +135,7 @@ static int stmmac_get_time(struct ptp_clock_info *ptp,
>> struct timespec *ts)
>>    * hardware clock.
>>    */
>>   static int stmmac_set_time(struct ptp_clock_info *ptp,
>> -                          const struct timespec *ts)
>> +                          const struct timespec64 *ts)
>>   {
>>         struct stmmac_priv *priv =
>>             container_of(ptp, struct stmmac_priv, ptp_clock_ops);
>> @@ -168,8 +168,8 @@ static struct ptp_clock_info stmmac_ptp_clock_ops = {
>>         .pps = 0,
>>         .adjfreq = stmmac_adjust_freq,
>>         .adjtime = stmmac_adjust_time,
>> -       .gettime = stmmac_get_time,
>> -       .settime = stmmac_set_time,
>> +       .gettime64 = stmmac_get_time,
>> +       .settime64 = stmmac_set_time,
>>         .enable = stmmac_enable,
>>   };
>>
>>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index c5ee79d8..172f318 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -105,7 +105,7 @@  static int stmmac_adjust_time(struct ptp_clock_info *ptp, s64 delta)
  * Description: this function will read the current time from the
  * hardware clock and store it in @ts.
  */
-static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
+static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
 	struct stmmac_priv *priv =
 	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
@@ -135,7 +135,7 @@  static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec *ts)
  * hardware clock.
  */
 static int stmmac_set_time(struct ptp_clock_info *ptp,
-			   const struct timespec *ts)
+			   const struct timespec64 *ts)
 {
 	struct stmmac_priv *priv =
 	    container_of(ptp, struct stmmac_priv, ptp_clock_ops);
@@ -168,8 +168,8 @@  static struct ptp_clock_info stmmac_ptp_clock_ops = {
 	.pps = 0,
 	.adjfreq = stmmac_adjust_freq,
 	.adjtime = stmmac_adjust_time,
-	.gettime = stmmac_get_time,
-	.settime = stmmac_set_time,
+	.gettime64 = stmmac_get_time,
+	.settime64 = stmmac_set_time,
 	.enable = stmmac_enable,
 };