mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: myungjoo.ham@samsung.com, cw00.choi@samsung.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: Remove deadcode
Date: Fri, 6 Dec 2024 02:26:35 +0000	[thread overview]
Message-ID: <Z1Jg2zRT9ecClJH7@gallifrey> (raw)
In-Reply-To: <20241103160535.268705-1-linux@treblig.org>

* linux@treblig.org (linux@treblig.org) wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> extcon_get_edev_name() has been unused since it was added in 2015 by
> commit 707d7550875a ("extcon: Add extcon_get_edev_name() API to get the
> extcon device name")
> 
> extcon_get_property_capability() has been unused since it was added
> in 2016 by
> commit ceaa98f442cf ("extcon: Add the support for the capability of each
> property")
> (It seems everyone just uses extcon_get_property)
> 
> extcon_set_property_sync() has been unused since it was added in 2016
> by
> commit a580982f0836 ("extcon: Add the synchronization extcon APIs to
> support the notification")
> Everyone seems to use the none _sync version, and there's one place
> where they just call sync after it.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Gentle ping please; no rush.

Dave

> ---
>  drivers/extcon/extcon.c         | 67 ---------------------------------
>  include/linux/extcon-provider.h | 10 -----
>  include/linux/extcon.h          | 20 +---------
>  3 files changed, 1 insertion(+), 96 deletions(-)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index e7f55c021e56..41a31cc46004 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -755,63 +755,6 @@ int extcon_set_property(struct extcon_dev *edev, unsigned int id,
>  }
>  EXPORT_SYMBOL_GPL(extcon_set_property);
>  
> -/**
> - * extcon_set_property_sync() - Set property of an external connector with sync.
> - * @edev:	the extcon device
> - * @id:		the unique id indicating an external connector
> - * @prop:	the property id indicating an extcon property
> - * @prop_val:	the pointer including the new value of extcon property
> - *
> - * Note that when setting the property value of external connector,
> - * the external connector should be attached. The each property should
> - * be included in the list of supported properties according to extcon type.
> - *
> - * Returns 0 if success or error number if fail.
> - */
> -int extcon_set_property_sync(struct extcon_dev *edev, unsigned int id,
> -				unsigned int prop,
> -				union extcon_property_value prop_val)
> -{
> -	int ret;
> -
> -	ret = extcon_set_property(edev, id, prop, prop_val);
> -	if (ret < 0)
> -		return ret;
> -
> -	return extcon_sync(edev, id);
> -}
> -EXPORT_SYMBOL_GPL(extcon_set_property_sync);
> -
> -/**
> - * extcon_get_property_capability() - Get the capability of the property
> - *					for an external connector.
> - * @edev:	the extcon device
> - * @id:		the unique id indicating an external connector
> - * @prop:	the property id indicating an extcon property
> - *
> - * Returns 1 if the property is available or 0 if not available.
> - */
> -int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id,
> -					unsigned int prop)
> -{
> -	int index;
> -
> -	if (!edev)
> -		return -EINVAL;
> -
> -	/* Check whether the property is supported or not */
> -	if (!is_extcon_property_supported(id, prop))
> -		return -EINVAL;
> -
> -	/* Find the cable index of external connector by using id */
> -	index = find_cable_index_by_id(edev, id);
> -	if (index < 0)
> -		return index;
> -
> -	return is_extcon_property_capability(edev, id, index, prop);
> -}
> -EXPORT_SYMBOL_GPL(extcon_get_property_capability);
> -
>  /**
>   * extcon_set_property_capability() - Set the capability of the property
>   *					for an external connector.
> @@ -1465,16 +1408,6 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, int index)
>  EXPORT_SYMBOL_GPL(extcon_find_edev_by_node);
>  EXPORT_SYMBOL_GPL(extcon_get_edev_by_phandle);
>  
> -/**
> - * extcon_get_edev_name() - Get the name of the extcon device.
> - * @edev:	the extcon device
> - */
> -const char *extcon_get_edev_name(struct extcon_dev *edev)
> -{
> -	return !edev ? NULL : edev->name;
> -}
> -EXPORT_SYMBOL_GPL(extcon_get_edev_name);
> -
>  static int __init extcon_class_init(void)
>  {
>  	return create_extcon_class();
> diff --git a/include/linux/extcon-provider.h b/include/linux/extcon-provider.h
> index fa70945f4e6b..4ed3262f4386 100644
> --- a/include/linux/extcon-provider.h
> +++ b/include/linux/extcon-provider.h
> @@ -55,9 +55,6 @@ int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id,
>  int extcon_set_property(struct extcon_dev *edev, unsigned int id,
>  				unsigned int prop,
>  				union extcon_property_value prop_val);
> -int extcon_set_property_sync(struct extcon_dev *edev, unsigned int id,
> -				unsigned int prop,
> -				union extcon_property_value prop_val);
>  int extcon_set_property_capability(struct extcon_dev *edev,
>  				unsigned int id, unsigned int prop);
>  
> @@ -118,13 +115,6 @@ static inline int extcon_set_property(struct extcon_dev *edev, unsigned int id,
>  	return 0;
>  }
>  
> -static inline int extcon_set_property_sync(struct extcon_dev *edev,
> -				unsigned int id, unsigned int prop,
> -				union extcon_property_value prop_val)
> -{
> -	return 0;
> -}
> -
>  static inline int extcon_set_property_capability(struct extcon_dev *edev,
>  				unsigned int id, unsigned int prop)
>  {
> diff --git a/include/linux/extcon.h b/include/linux/extcon.h
> index e596a0abcb27..eb55b25e74ae 100644
> --- a/include/linux/extcon.h
> +++ b/include/linux/extcon.h
> @@ -175,19 +175,14 @@ struct extcon_dev;
>  int extcon_get_state(struct extcon_dev *edev, unsigned int id);
>  
>  /*
> - * Following APIs get the property of each external connector.
> + * Following API get the property of each external connector.
>   * The 'id' argument indicates the defined external connector
>   * and the 'prop' indicates the extcon property.
>   *
> - * And extcon_get_property_capability() get the capability of the property
> - * for each external connector. They are used to get the capability of the
> - * property of each external connector based on the id and property.
>   */
>  int extcon_get_property(struct extcon_dev *edev, unsigned int id,
>  				unsigned int prop,
>  				union extcon_property_value *prop_val);
> -int extcon_get_property_capability(struct extcon_dev *edev,
> -				unsigned int id, unsigned int prop);
>  
>  /*
>   * Following APIs register the notifier block in order to detect
> @@ -228,9 +223,6 @@ struct extcon_dev *extcon_find_edev_by_node(struct device_node *node);
>  struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
>  						     int index);
>  
> -/* Following API get the name of extcon device. */
> -const char *extcon_get_edev_name(struct extcon_dev *edev);
> -
>  #else /* CONFIG_EXTCON */
>  static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id)
>  {
> @@ -244,12 +236,6 @@ static inline int extcon_get_property(struct extcon_dev *edev, unsigned int id,
>  	return 0;
>  }
>  
> -static inline int extcon_get_property_capability(struct extcon_dev *edev,
> -				unsigned int id, unsigned int prop)
> -{
> -	return 0;
> -}
> -
>  static inline int extcon_register_notifier(struct extcon_dev *edev,
>  				unsigned int id, struct notifier_block *nb)
>  {
> @@ -312,10 +298,6 @@ static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
>  	return ERR_PTR(-ENODEV);
>  }
>  
> -static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
> -{
> -	return NULL;
> -}
>  #endif /* CONFIG_EXTCON */
>  
>  /*
> -- 
> 2.47.0
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

  reply	other threads:[~2024-12-06  2:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03 16:05 linux
2024-12-06  2:26 ` Dr. David Alan Gilbert [this message]
     [not found] ` <CGME20241206022643epcas1p1db6da634d4da398f553b7dd3cfa3339f@epcms1p2>
2024-12-07  4:58   ` MyungJoo Ham
2024-12-07 21:35     ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1Jg2zRT9ecClJH7@gallifrey \
    --to=linux@treblig.org \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome