File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -557,7 +557,10 @@ const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
557
557
if (!group )
558
558
return NULL ;
559
559
560
- return group -> name ;
560
+ if (group -> name )
561
+ return group -> name ;
562
+
563
+ return group -> grp .name ;
561
564
}
562
565
EXPORT_SYMBOL_GPL (pinctrl_generic_get_group_name );
563
566
@@ -583,8 +586,14 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev,
583
586
return - EINVAL ;
584
587
}
585
588
586
- * pins = group -> pins ;
587
- * num_pins = group -> num_pins ;
589
+ if (group -> pins ) {
590
+ * pins = group -> pins ;
591
+ * num_pins = group -> num_pins ;
592
+ return 0 ;
593
+ }
594
+
595
+ * pins = group -> grp .pins ;
596
+ * num_pins = group -> grp .npins ;
588
597
589
598
return 0 ;
590
599
}
Original file line number Diff line number Diff line change @@ -194,14 +194,18 @@ struct pinctrl_maps {
194
194
195
195
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
196
196
197
+ #include <linux/pinctrl/pinctrl.h>
198
+
197
199
/**
198
200
* struct group_desc - generic pin group descriptor
201
+ * @grp: generic data of the pin group (name and pins)
199
202
* @name: name of the pin group
200
203
* @pins: array of pins that belong to the group
201
204
* @num_pins: number of pins in the group
202
205
* @data: pin controller driver specific data
203
206
*/
204
207
struct group_desc {
208
+ struct pingroup grp ;
205
209
const char * name ;
206
210
const unsigned int * pins ;
207
211
int num_pins ;
@@ -211,6 +215,7 @@ struct group_desc {
211
215
/* Convenience macro to define a generic pin group descriptor */
212
216
#define PINCTRL_GROUP_DESC (_name , _pins , _num_pins , _data ) \
213
217
(struct group_desc) { \
218
+ .grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
214
219
.name = _name, \
215
220
.pins = _pins, \
216
221
.num_pins = _num_pins, \
You can’t perform that action at this time.
0 commit comments