diff mbox

[3/3] ath10k: add symlink for hwmon device

Message ID 1424437452-28161-3-git-send-email-rmanohar@qti.qualcomm.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Rajkumar Manoharan Feb. 20, 2015, 1:04 p.m. UTC
Add symbloic link "thermal_sensors" for hwmon devices for better
readability.

/sys/class/ieee80211/phyX/device/thermal_sensors ->
sys/class/ieee80211/phyX/device/hwmon/hwmonY

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/thermal.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Kalle Valo March 10, 2015, 3:39 p.m. UTC | #1
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:

> Add symbloic link "thermal_sensors" for hwmon devices for better
> readability.
>
> /sys/class/ieee80211/phyX/device/thermal_sensors ->
> sys/class/ieee80211/phyX/device/hwmon/hwmonY

I don't get it, how does that improve readability? Also I don't see any
other driver doing this, so isn't this just some private hack and not a
proper generic interface?
Rajkumar Manoharan March 10, 2015, 4:42 p.m. UTC | #2
On Tue, Mar 10, 2015 at 05:39:46PM +0200, Kalle Valo wrote:
> Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> 
> > Add symbloic link "thermal_sensors" for hwmon devices for better
> > readability.
> >
> > /sys/class/ieee80211/phyX/device/thermal_sensors ->
> > sys/class/ieee80211/phyX/device/hwmon/hwmonY
> 
> I don't get it, how does that improve readability? Also I don't see any
> other driver doing this, so isn't this just some private hack and not a
> proper generic interface?
>
The patch is providing same level access to monitoring device similar to
cooling device.

cooling_device -> ../../../../../virtual/thermal/cooling_deviceX
thermal_sensors -> hwmon/hwmonX

-Rajkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kalle Valo March 12, 2015, 1:20 p.m. UTC | #3
Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:

> On Tue, Mar 10, 2015 at 05:39:46PM +0200, Kalle Valo wrote:
>> Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
>> 
>> > Add symbloic link "thermal_sensors" for hwmon devices for better
>> > readability.
>> >
>> > /sys/class/ieee80211/phyX/device/thermal_sensors ->
>> > sys/class/ieee80211/phyX/device/hwmon/hwmonY
>> 
>> I don't get it, how does that improve readability? Also I don't see any
>> other driver doing this, so isn't this just some private hack and not a
>> proper generic interface?
>
> The patch is providing same level access to monitoring device similar to
> cooling device.
>
> cooling_device -> ../../../../../virtual/thermal/cooling_deviceX
> thermal_sensors -> hwmon/hwmonX

Is this documented somewhere? We cannot just start inventing sysfs
interfaces on our own.
Rajkumar Manoharan March 12, 2015, 1:46 p.m. UTC | #4
On Thu, Mar 12, 2015 at 03:20:33PM +0200, Kalle Valo wrote:
> Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> 
> > On Tue, Mar 10, 2015 at 05:39:46PM +0200, Kalle Valo wrote:
> >> Rajkumar Manoharan <rmanohar@qti.qualcomm.com> writes:
> >> 
> >> > Add symbloic link "thermal_sensors" for hwmon devices for better
> >> > readability.
> >> >
> >> > /sys/class/ieee80211/phyX/device/thermal_sensors ->
> >> > sys/class/ieee80211/phyX/device/hwmon/hwmonY
> >> 
> >> I don't get it, how does that improve readability? Also I don't see any
> >> other driver doing this, so isn't this just some private hack and not a
> >> proper generic interface?
> >
> > The patch is providing same level access to monitoring device similar to
> > cooling device.
> >
> > cooling_device -> ../../../../../virtual/thermal/cooling_deviceX
> > thermal_sensors -> hwmon/hwmonX
> 
> Is this documented somewhere? We cannot just start inventing sysfs
> interfaces on our own.
>
Agree. this is not a standard interface. I added symlink just to provide
user readable name instead of hwmon. Please drop this change, if it does
not add any values to existing interface.

-Rajkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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/wireless/ath/ath10k/thermal.c b/drivers/net/wireless/ath/ath10k/thermal.c
index 7c54bb1..f601e3e 100644
--- a/drivers/net/wireless/ath/ath10k/thermal.c
+++ b/drivers/net/wireless/ath/ath10k/thermal.c
@@ -276,6 +276,13 @@  int ath10k_thermal_register(struct ath10k *ar)
 		ret = -EINVAL;
 		goto err_remove_file;
 	}
+	ret = sysfs_create_link(&ar->dev->kobj, &hwmon_dev->kobj,
+				"thermal_sensors");
+	if (ret) {
+		ath10k_err(ar, "failed to create hwmon symlink\n");
+		goto err_remove_file;
+	}
+
 	return 0;
 
 err_remove_file:
@@ -292,4 +299,5 @@  void ath10k_thermal_unregister(struct ath10k *ar)
 	thermal_cooling_device_unregister(ar->thermal.cdev);
 	sysfs_remove_link(&ar->dev->kobj, "cooling_device");
 	sysfs_remove_file(&ar->dev->kobj, &dev_attr_quiet_period.attr);
+	sysfs_remove_link(&ar->dev->kobj, "thermal_sensors");
 }