public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: core: drop iio_get_time_res()
@ 2022-02-20 16:33 Jonathan Cameron
  2022-06-04 15:34 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2022-02-20 16:33 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

This function was introduced with the ability to pick a clock.
There are no upstream users so presumably it isn't as obviously useful
as it seemed at the time.  Hence drop it.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/industrialio-core.c | 23 -----------------------
 include/linux/iio/iio.h         |  1 -
 2 files changed, 24 deletions(-)

diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index e1ed44dec2ab..5d6c62d4a83d 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -320,29 +320,6 @@ s64 iio_get_time_ns(const struct iio_dev *indio_dev)
 }
 EXPORT_SYMBOL(iio_get_time_ns);
 
-/**
- * iio_get_time_res() - utility function to get time stamp clock resolution in
- *                      nano seconds.
- * @indio_dev: device
- */
-unsigned int iio_get_time_res(const struct iio_dev *indio_dev)
-{
-	switch (iio_device_get_clock(indio_dev)) {
-	case CLOCK_REALTIME:
-	case CLOCK_MONOTONIC:
-	case CLOCK_MONOTONIC_RAW:
-	case CLOCK_BOOTTIME:
-	case CLOCK_TAI:
-		return hrtimer_resolution;
-	case CLOCK_REALTIME_COARSE:
-	case CLOCK_MONOTONIC_COARSE:
-		return LOW_RES_NSEC;
-	default:
-		BUG();
-	}
-}
-EXPORT_SYMBOL(iio_get_time_res);
-
 static int __init iio_init(void)
 {
 	int ret;
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index faf00f2c0be6..13cd5f41b0de 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -313,7 +313,6 @@ static inline bool iio_channel_has_available(const struct iio_chan_spec *chan,
 }
 
 s64 iio_get_time_ns(const struct iio_dev *indio_dev);
-unsigned int iio_get_time_res(const struct iio_dev *indio_dev);
 
 /* Device operating modes */
 #define INDIO_DIRECT_MODE		0x01
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: core: drop iio_get_time_res()
  2022-02-20 16:33 [PATCH] iio: core: drop iio_get_time_res() Jonathan Cameron
@ 2022-06-04 15:34 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-06-04 15:34 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

On Sun, 20 Feb 2022 16:33:27 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> This function was introduced with the ability to pick a clock.
> There are no upstream users so presumably it isn't as obviously useful
> as it seemed at the time.  Hence drop it.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Whilst I normally am pretty rigid in pestering people to review my
patches, this one seems safe enough given it just removes clearly
unused code.

As such, applied to the togreg branch of iio.git so I can forget about it.
(by which I mean mark it applied in patchwork)

Thanks,

Jonathan

> ---
>  drivers/iio/industrialio-core.c | 23 -----------------------
>  include/linux/iio/iio.h         |  1 -
>  2 files changed, 24 deletions(-)
> 
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index e1ed44dec2ab..5d6c62d4a83d 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -320,29 +320,6 @@ s64 iio_get_time_ns(const struct iio_dev *indio_dev)
>  }
>  EXPORT_SYMBOL(iio_get_time_ns);
>  
> -/**
> - * iio_get_time_res() - utility function to get time stamp clock resolution in
> - *                      nano seconds.
> - * @indio_dev: device
> - */
> -unsigned int iio_get_time_res(const struct iio_dev *indio_dev)
> -{
> -	switch (iio_device_get_clock(indio_dev)) {
> -	case CLOCK_REALTIME:
> -	case CLOCK_MONOTONIC:
> -	case CLOCK_MONOTONIC_RAW:
> -	case CLOCK_BOOTTIME:
> -	case CLOCK_TAI:
> -		return hrtimer_resolution;
> -	case CLOCK_REALTIME_COARSE:
> -	case CLOCK_MONOTONIC_COARSE:
> -		return LOW_RES_NSEC;
> -	default:
> -		BUG();
> -	}
> -}
> -EXPORT_SYMBOL(iio_get_time_res);
> -
>  static int __init iio_init(void)
>  {
>  	int ret;
> diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> index faf00f2c0be6..13cd5f41b0de 100644
> --- a/include/linux/iio/iio.h
> +++ b/include/linux/iio/iio.h
> @@ -313,7 +313,6 @@ static inline bool iio_channel_has_available(const struct iio_chan_spec *chan,
>  }
>  
>  s64 iio_get_time_ns(const struct iio_dev *indio_dev);
> -unsigned int iio_get_time_res(const struct iio_dev *indio_dev);
>  
>  /* Device operating modes */
>  #define INDIO_DIRECT_MODE		0x01


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-04 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-20 16:33 [PATCH] iio: core: drop iio_get_time_res() Jonathan Cameron
2022-06-04 15:34 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox