All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: arnd@arndb.de
Cc: hch@lst.de, andriy.shevchenko@intel.com,
	dan.j.williams@intel.com, linux-kernel@vger.kernel.org
Subject: [PATCH v3 1/2] misc: enclosure: remove get_active callback
Date: Tue, 30 May 2023 16:02:22 +0200	[thread overview]
Message-ID: <20230530140223.13994-2-mariusz.tkaczyk@linux.intel.com> (raw)
In-Reply-To: <20230530140223.13994-1-mariusz.tkaczyk@linux.intel.com>

The callback is not used, remove it. Leave possibility to read cached
ecomp->active value.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
 drivers/misc/enclosure.c  | 4 +---
 include/linux/enclosure.h | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 1b010d9267c9..59704fdb962a 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -534,11 +534,9 @@ static ssize_t set_component_status(struct device *cdev,
 static ssize_t get_component_active(struct device *cdev,
 				    struct device_attribute *attr, char *buf)
 {
-	struct enclosure_device *edev = to_enclosure_device(cdev->parent);
 	struct enclosure_component *ecomp = to_enclosure_component(cdev);
 
-	if (edev->cb->get_active)
-		edev->cb->get_active(edev, ecomp);
+	/* The value may have been updated by edev->cb->set_active(). */
 	return sysfs_emit(buf, "%d\n", ecomp->active);
 }
 
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
index 1c630e2c2756..8d09c6d07bf1 100644
--- a/include/linux/enclosure.h
+++ b/include/linux/enclosure.h
@@ -62,8 +62,6 @@ struct enclosure_component_callbacks {
 	int (*set_fault)(struct enclosure_device *,
 			 struct enclosure_component *,
 			 enum enclosure_component_setting);
-	void (*get_active)(struct enclosure_device *,
-			   struct enclosure_component *);
 	int (*set_active)(struct enclosure_device *,
 			  struct enclosure_component *,
 			  enum enclosure_component_setting);
-- 
2.26.2


  reply	other threads:[~2023-05-30 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 14:02 [PATCH v3 0/2] Enclosure interface cleanups Mariusz Tkaczyk
2023-05-30 14:02 ` Mariusz Tkaczyk [this message]
2023-05-30 14:36   ` [PATCH v3 1/2] misc: enclosure: remove get_active callback Christoph Hellwig
2023-07-05  7:28     ` Mariusz Tkaczyk
2023-05-30 14:02 ` [PATCH v3 2/2] misc: enclosure: use DEVICE_ATTR_RW* macros Mariusz Tkaczyk

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=20230530140223.13994-2-mariusz.tkaczyk@linux.intel.com \
    --to=mariusz.tkaczyk@linux.intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.