* [PATCH 0/2] pinctrl: pinmux: Update error reporting in pin_request()
@ 2023-09-09 6:36 Jernej Skrabec
2023-09-09 6:36 ` [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message " Jernej Skrabec
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
0 siblings, 2 replies; 9+ messages in thread
From: Jernej Skrabec @ 2023-09-09 6:36 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, linux-kernel, Jernej Skrabec
Currently pin_request() may prints two error messages for same error.
Additionally, it also prints error message when status is -EPROBE_DEFER.
Fix that by removing duplicate error reporting and use dev_err_probe()
instead of ordinary dev_err().
Best regards,
Jernej
Jernej Skrabec (2):
pinctrl: pinmux: Remove duplicate error message in pin_request()
pinctrl: pinmux: Use dev_err_probe() in pin_request()
drivers/pinctrl/pinmux.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message in pin_request()
2023-09-09 6:36 [PATCH 0/2] pinctrl: pinmux: Update error reporting in pin_request() Jernej Skrabec
@ 2023-09-09 6:36 ` Jernej Skrabec
2023-09-12 8:16 ` Linus Walleij
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
1 sibling, 1 reply; 9+ messages in thread
From: Jernej Skrabec @ 2023-09-09 6:36 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, linux-kernel, Jernej Skrabec
Detailed error message is already printed at the end of the function, so
drop redundant one a few lines earlier.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
drivers/pinctrl/pinmux.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 2a180a5d64a4..301fe0157b02 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -173,10 +173,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
else
status = 0;
- if (status) {
- dev_err(pctldev->dev, "request() failed for pin %d\n", pin);
+ if (status)
module_put(pctldev->owner);
- }
out_free_pin:
if (status) {
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-09 6:36 [PATCH 0/2] pinctrl: pinmux: Update error reporting in pin_request() Jernej Skrabec
2023-09-09 6:36 ` [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message " Jernej Skrabec
@ 2023-09-09 6:36 ` Jernej Skrabec
2023-09-09 9:44 ` kernel test robot
` (3 more replies)
1 sibling, 4 replies; 9+ messages in thread
From: Jernej Skrabec @ 2023-09-09 6:36 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, linux-kernel, Jernej Skrabec
Use dev_err_probe() when printing error message in pin_request() since
it may fail with -EPROBE_DEFER.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
drivers/pinctrl/pinmux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 301fe0157b02..4a9776a99d20 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -188,8 +188,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
}
out:
if (status)
- dev_err(pctldev->dev, "pin-%d (%s) status %d\n",
- pin, owner, status);
+ dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
+ pin, owner, status);
return status;
}
--
2.42.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
@ 2023-09-09 9:44 ` kernel test robot
2023-09-09 10:06 ` kernel test robot
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-09-09 9:44 UTC (permalink / raw)
To: Jernej Skrabec, linus.walleij
Cc: oe-kbuild-all, linux-gpio, linux-kernel, Jernej Skrabec
Hi Jernej,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next linus/master v6.5 next-20230908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jernej-Skrabec/pinctrl-pinmux-Remove-duplicate-error-message-in-pin_request/20230909-143817
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20230909063613.2867-3-jernej.skrabec%40gmail.com
patch subject: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230909/202309091753.JqeFteSy-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230909/202309091753.JqeFteSy-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309091753.JqeFteSy-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/pinctrl/pinmux.c: In function 'pin_request':
>> drivers/pinctrl/pinmux.c:191:45: warning: passing argument 2 of 'dev_err_probe' makes integer from pointer without a cast [-Wint-conversion]
191 | dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| char *
In file included from drivers/pinctrl/pinmux.c:17:
include/linux/device.h:1218:64: note: expected 'int' but argument is of type 'char *'
1218 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~^~~
>> drivers/pinctrl/pinmux.c:192:31: warning: passing argument 3 of 'dev_err_probe' makes pointer from integer without a cast [-Wint-conversion]
192 | pin, owner, status);
| ^~~
| |
| int
include/linux/device.h:1218:81: note: expected 'const char *' but argument is of type 'int'
1218 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ~~~~~~~~~~~~^~~
vim +/dev_err_probe +191 drivers/pinctrl/pinmux.c
101
102 /**
103 * pin_request() - request a single pin to be muxed in, typically for GPIO
104 * @pctldev: the associated pin controller device
105 * @pin: the pin number in the global pin space
106 * @owner: a representation of the owner of this pin; typically the device
107 * name that controls its mux function, or the requested GPIO name
108 * @gpio_range: the range matching the GPIO pin if this is a request for a
109 * single GPIO pin
110 */
111 static int pin_request(struct pinctrl_dev *pctldev,
112 int pin, const char *owner,
113 struct pinctrl_gpio_range *gpio_range)
114 {
115 struct pin_desc *desc;
116 const struct pinmux_ops *ops = pctldev->desc->pmxops;
117 int status = -EINVAL;
118
119 desc = pin_desc_get(pctldev, pin);
120 if (desc == NULL) {
121 dev_err(pctldev->dev,
122 "pin %d is not registered so it cannot be requested\n",
123 pin);
124 goto out;
125 }
126
127 dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
128 pin, desc->name, owner);
129
130 if ((!gpio_range || ops->strict) &&
131 desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
132 dev_err(pctldev->dev,
133 "pin %s already requested by %s; cannot claim for %s\n",
134 desc->name, desc->mux_owner, owner);
135 goto out;
136 }
137
138 if ((gpio_range || ops->strict) && desc->gpio_owner) {
139 dev_err(pctldev->dev,
140 "pin %s already requested by %s; cannot claim for %s\n",
141 desc->name, desc->gpio_owner, owner);
142 goto out;
143 }
144
145 if (gpio_range) {
146 desc->gpio_owner = owner;
147 } else {
148 desc->mux_usecount++;
149 if (desc->mux_usecount > 1)
150 return 0;
151
152 desc->mux_owner = owner;
153 }
154
155 /* Let each pin increase references to this module */
156 if (!try_module_get(pctldev->owner)) {
157 dev_err(pctldev->dev,
158 "could not increase module refcount for pin %d\n",
159 pin);
160 status = -EINVAL;
161 goto out_free_pin;
162 }
163
164 /*
165 * If there is no kind of request function for the pin we just assume
166 * we got it by default and proceed.
167 */
168 if (gpio_range && ops->gpio_request_enable)
169 /* This requests and enables a single GPIO pin */
170 status = ops->gpio_request_enable(pctldev, gpio_range, pin);
171 else if (ops->request)
172 status = ops->request(pctldev, pin);
173 else
174 status = 0;
175
176 if (status)
177 module_put(pctldev->owner);
178
179 out_free_pin:
180 if (status) {
181 if (gpio_range) {
182 desc->gpio_owner = NULL;
183 } else {
184 desc->mux_usecount--;
185 if (!desc->mux_usecount)
186 desc->mux_owner = NULL;
187 }
188 }
189 out:
190 if (status)
> 191 dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
> 192 pin, owner, status);
193
194 return status;
195 }
196
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
2023-09-09 9:44 ` kernel test robot
@ 2023-09-09 10:06 ` kernel test robot
2023-09-09 13:12 ` kernel test robot
2023-09-12 8:15 ` Linus Walleij
3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-09-09 10:06 UTC (permalink / raw)
To: Jernej Skrabec, linus.walleij
Cc: llvm, oe-kbuild-all, linux-gpio, linux-kernel, Jernej Skrabec
Hi Jernej,
kernel test robot noticed the following build errors:
[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next linus/master v6.5 next-20230908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jernej-Skrabec/pinctrl-pinmux-Remove-duplicate-error-message-in-pin_request/20230909-143817
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20230909063613.2867-3-jernej.skrabec%40gmail.com
patch subject: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
config: hexagon-randconfig-002-20230909 (https://download.01.org/0day-ci/archive/20230909/202309091724.tJzAxzS5-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230909/202309091724.tJzAxzS5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309091724.tJzAxzS5-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/pinctrl/pinmux.c:191:31: error: incompatible pointer to integer conversion passing 'char[23]' to parameter of type 'int' [-Wint-conversion]
191 | dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1218:64: note: passing argument to parameter 'err' here
1218 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ^
>> drivers/pinctrl/pinmux.c:192:10: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
192 | pin, owner, status);
| ^~~
include/linux/device.h:1218:81: note: passing argument to parameter 'fmt' here
1218 | __printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
| ^
2 errors generated.
vim +191 drivers/pinctrl/pinmux.c
101
102 /**
103 * pin_request() - request a single pin to be muxed in, typically for GPIO
104 * @pctldev: the associated pin controller device
105 * @pin: the pin number in the global pin space
106 * @owner: a representation of the owner of this pin; typically the device
107 * name that controls its mux function, or the requested GPIO name
108 * @gpio_range: the range matching the GPIO pin if this is a request for a
109 * single GPIO pin
110 */
111 static int pin_request(struct pinctrl_dev *pctldev,
112 int pin, const char *owner,
113 struct pinctrl_gpio_range *gpio_range)
114 {
115 struct pin_desc *desc;
116 const struct pinmux_ops *ops = pctldev->desc->pmxops;
117 int status = -EINVAL;
118
119 desc = pin_desc_get(pctldev, pin);
120 if (desc == NULL) {
121 dev_err(pctldev->dev,
122 "pin %d is not registered so it cannot be requested\n",
123 pin);
124 goto out;
125 }
126
127 dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
128 pin, desc->name, owner);
129
130 if ((!gpio_range || ops->strict) &&
131 desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
132 dev_err(pctldev->dev,
133 "pin %s already requested by %s; cannot claim for %s\n",
134 desc->name, desc->mux_owner, owner);
135 goto out;
136 }
137
138 if ((gpio_range || ops->strict) && desc->gpio_owner) {
139 dev_err(pctldev->dev,
140 "pin %s already requested by %s; cannot claim for %s\n",
141 desc->name, desc->gpio_owner, owner);
142 goto out;
143 }
144
145 if (gpio_range) {
146 desc->gpio_owner = owner;
147 } else {
148 desc->mux_usecount++;
149 if (desc->mux_usecount > 1)
150 return 0;
151
152 desc->mux_owner = owner;
153 }
154
155 /* Let each pin increase references to this module */
156 if (!try_module_get(pctldev->owner)) {
157 dev_err(pctldev->dev,
158 "could not increase module refcount for pin %d\n",
159 pin);
160 status = -EINVAL;
161 goto out_free_pin;
162 }
163
164 /*
165 * If there is no kind of request function for the pin we just assume
166 * we got it by default and proceed.
167 */
168 if (gpio_range && ops->gpio_request_enable)
169 /* This requests and enables a single GPIO pin */
170 status = ops->gpio_request_enable(pctldev, gpio_range, pin);
171 else if (ops->request)
172 status = ops->request(pctldev, pin);
173 else
174 status = 0;
175
176 if (status)
177 module_put(pctldev->owner);
178
179 out_free_pin:
180 if (status) {
181 if (gpio_range) {
182 desc->gpio_owner = NULL;
183 } else {
184 desc->mux_usecount--;
185 if (!desc->mux_usecount)
186 desc->mux_owner = NULL;
187 }
188 }
189 out:
190 if (status)
> 191 dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
> 192 pin, owner, status);
193
194 return status;
195 }
196
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
2023-09-09 9:44 ` kernel test robot
2023-09-09 10:06 ` kernel test robot
@ 2023-09-09 13:12 ` kernel test robot
2023-09-12 8:15 ` Linus Walleij
3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2023-09-09 13:12 UTC (permalink / raw)
To: Jernej Skrabec, linus.walleij
Cc: llvm, oe-kbuild-all, linux-gpio, linux-kernel, Jernej Skrabec
Hi Jernej,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next linus/master v6.5 next-20230908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Jernej-Skrabec/pinctrl-pinmux-Remove-duplicate-error-message-in-pin_request/20230909-143817
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20230909063613.2867-3-jernej.skrabec%40gmail.com
patch subject: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
config: arm-randconfig-001-20230909 (https://download.01.org/0day-ci/archive/20230909/202309092056.azXQNtDr-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230909/202309092056.azXQNtDr-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309092056.azXQNtDr-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/pinctrl/pinmux.c:191:31: warning: incompatible pointer to integer conversion passing 'char[23]' to parameter of type 'int' [-Wint-conversion]
dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1218:64: note: passing argument to parameter 'err' here
__printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
^
>> drivers/pinctrl/pinmux.c:192:10: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]
pin, owner, status);
^~~
include/linux/device.h:1218:81: note: passing argument to parameter 'fmt' here
__printf(3, 4) int dev_err_probe(const struct device *dev, int err, const char *fmt, ...);
^
2 warnings generated.
vim +191 drivers/pinctrl/pinmux.c
101
102 /**
103 * pin_request() - request a single pin to be muxed in, typically for GPIO
104 * @pctldev: the associated pin controller device
105 * @pin: the pin number in the global pin space
106 * @owner: a representation of the owner of this pin; typically the device
107 * name that controls its mux function, or the requested GPIO name
108 * @gpio_range: the range matching the GPIO pin if this is a request for a
109 * single GPIO pin
110 */
111 static int pin_request(struct pinctrl_dev *pctldev,
112 int pin, const char *owner,
113 struct pinctrl_gpio_range *gpio_range)
114 {
115 struct pin_desc *desc;
116 const struct pinmux_ops *ops = pctldev->desc->pmxops;
117 int status = -EINVAL;
118
119 desc = pin_desc_get(pctldev, pin);
120 if (desc == NULL) {
121 dev_err(pctldev->dev,
122 "pin %d is not registered so it cannot be requested\n",
123 pin);
124 goto out;
125 }
126
127 dev_dbg(pctldev->dev, "request pin %d (%s) for %s\n",
128 pin, desc->name, owner);
129
130 if ((!gpio_range || ops->strict) &&
131 desc->mux_usecount && strcmp(desc->mux_owner, owner)) {
132 dev_err(pctldev->dev,
133 "pin %s already requested by %s; cannot claim for %s\n",
134 desc->name, desc->mux_owner, owner);
135 goto out;
136 }
137
138 if ((gpio_range || ops->strict) && desc->gpio_owner) {
139 dev_err(pctldev->dev,
140 "pin %s already requested by %s; cannot claim for %s\n",
141 desc->name, desc->gpio_owner, owner);
142 goto out;
143 }
144
145 if (gpio_range) {
146 desc->gpio_owner = owner;
147 } else {
148 desc->mux_usecount++;
149 if (desc->mux_usecount > 1)
150 return 0;
151
152 desc->mux_owner = owner;
153 }
154
155 /* Let each pin increase references to this module */
156 if (!try_module_get(pctldev->owner)) {
157 dev_err(pctldev->dev,
158 "could not increase module refcount for pin %d\n",
159 pin);
160 status = -EINVAL;
161 goto out_free_pin;
162 }
163
164 /*
165 * If there is no kind of request function for the pin we just assume
166 * we got it by default and proceed.
167 */
168 if (gpio_range && ops->gpio_request_enable)
169 /* This requests and enables a single GPIO pin */
170 status = ops->gpio_request_enable(pctldev, gpio_range, pin);
171 else if (ops->request)
172 status = ops->request(pctldev, pin);
173 else
174 status = 0;
175
176 if (status)
177 module_put(pctldev->owner);
178
179 out_free_pin:
180 if (status) {
181 if (gpio_range) {
182 desc->gpio_owner = NULL;
183 } else {
184 desc->mux_usecount--;
185 if (!desc->mux_usecount)
186 desc->mux_owner = NULL;
187 }
188 }
189 out:
190 if (status)
> 191 dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
> 192 pin, owner, status);
193
194 return status;
195 }
196
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
` (2 preceding siblings ...)
2023-09-09 13:12 ` kernel test robot
@ 2023-09-12 8:15 ` Linus Walleij
2023-09-12 15:52 ` Jernej Škrabec
3 siblings, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2023-09-12 8:15 UTC (permalink / raw)
To: Jernej Skrabec; +Cc: linux-gpio, linux-kernel
Hi Jenej,
thanks for your patch!
On Sat, Sep 9, 2023 at 8:36 AM Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
> Use dev_err_probe() when printing error message in pin_request() since
> it may fail with -EPROBE_DEFER.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
(...)
> if (status)
> - dev_err(pctldev->dev, "pin-%d (%s) status %d\n",
> - pin, owner, status);
> + dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
> + pin, owner, status);
>
> return status;
That's not how you use dev_err_probe()
Just replace all of the lines above with return dev_err_probe(...)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message in pin_request()
2023-09-09 6:36 ` [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message " Jernej Skrabec
@ 2023-09-12 8:16 ` Linus Walleij
0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2023-09-12 8:16 UTC (permalink / raw)
To: Jernej Skrabec; +Cc: linux-gpio, linux-kernel
On Sat, Sep 9, 2023 at 8:36 AM Jernej Skrabec <jernej.skrabec@gmail.com> wrote:
> Detailed error message is already printed at the end of the function, so
> drop redundant one a few lines earlier.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Patch applied!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() in pin_request()
2023-09-12 8:15 ` Linus Walleij
@ 2023-09-12 15:52 ` Jernej Škrabec
0 siblings, 0 replies; 9+ messages in thread
From: Jernej Škrabec @ 2023-09-12 15:52 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel
Dne torek, 12. september 2023 ob 10:15:31 CEST je Linus Walleij napisal(a):
> Hi Jenej,
>
> thanks for your patch!
>
> On Sat, Sep 9, 2023 at 8:36 AM Jernej Skrabec <jernej.skrabec@gmail.com>
wrote:
> > Use dev_err_probe() when printing error message in pin_request() since
> > it may fail with -EPROBE_DEFER.
> >
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> (...)
>
> > if (status)
> >
> > - dev_err(pctldev->dev, "pin-%d (%s) status %d\n",
> > - pin, owner, status);
> > + dev_err_probe(pctldev->dev, "pin-%d (%s) status %d\n",
> > + pin, owner, status);
> >
> > return status;
>
> That's not how you use dev_err_probe()
>
> Just replace all of the lines above with return dev_err_probe(...)
I already send v2 of this patch soon after I got report from kernel test
robot.
Best regards,
Jernej
>
> Yours,
> Linus Walleij
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-09-12 15:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-09 6:36 [PATCH 0/2] pinctrl: pinmux: Update error reporting in pin_request() Jernej Skrabec
2023-09-09 6:36 ` [PATCH 1/2] pinctrl: pinmux: Remove duplicate error message " Jernej Skrabec
2023-09-12 8:16 ` Linus Walleij
2023-09-09 6:36 ` [PATCH 2/2] pinctrl: pinmux: Use dev_err_probe() " Jernej Skrabec
2023-09-09 9:44 ` kernel test robot
2023-09-09 10:06 ` kernel test robot
2023-09-09 13:12 ` kernel test robot
2023-09-12 8:15 ` Linus Walleij
2023-09-12 15:52 ` Jernej Škrabec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).