From 21eb62de55584a389b52dbba31406210e1157d09 Mon Sep 17 00:00:00 2001 From: weiweij Date: Fri, 8 Apr 2022 14:04:11 +0800 Subject: [PATCH] charger: remove write permission from interface without "store" Some device attributes do not have the interface of store. If we reguard it as permission writable. We would get following errors: [ 22.517191] Attribute vbus: write permission without 'store' [ 22.522882] WARNING: CPU: 6 PID: 375 at drivers/base/core.c:2283 device_create_file+0x78/0x9c [[ 22.619397] Hardware name: miami (DT) [ 22.623067] pstate: 60400005 (nZCv daif +PAN -UAO) [ 22.627864] pc : device_create_file+0x78/0x9c [ 22.632219] lr : device_create_file+0x78/0x9c Change-Id: I7497b33aff38cc122825b44623a03bd2765b3a83 Reviewed-on: https://gerrit.mot.com/2237072 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/power/bq25980_mmi_iio/bq25980_mmi_iio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/bq25980_mmi_iio/bq25980_mmi_iio.c b/drivers/power/bq25980_mmi_iio/bq25980_mmi_iio.c index 71337d95383e..9f124415ceb4 100644 --- a/drivers/power/bq25980_mmi_iio/bq25980_mmi_iio.c +++ b/drivers/power/bq25980_mmi_iio/bq25980_mmi_iio.c @@ -1877,7 +1877,7 @@ static ssize_t show_reg_dump(struct device *dev, struct device_attribute *attr, return size; } -static DEVICE_ATTR(reg_dump, 0664, show_reg_dump, NULL); +static DEVICE_ATTR(reg_dump, 0444, show_reg_dump, NULL); static ssize_t show_vbus(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1891,7 +1891,7 @@ static ssize_t show_vbus(struct device *dev, struct device_attribute *attr, char return sprintf(buf, "%d\n", vbus); } -static DEVICE_ATTR(vbus, 0664, show_vbus, NULL); +static DEVICE_ATTR(vbus, 0444, show_vbus, NULL); static void bq25980_create_device_node(struct device *dev) {