Skip to content

Commit b9e1843

Browse files
committed
pinctrl: baytrail: Unify style of error and debug messages
Use same formatting strings where it makes sense, so linker will utilize only a single copy of it, otherwise make the style similar to the rest of the messages of the close enough semantics. add/remove: 1/0 grow/shrink: 2/2 up/down: 91/-110 (-19) Total: Before=17562, After=17543, chg -0.11% Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent ac9a786 commit b9e1843

1 file changed

Lines changed: 23 additions & 41 deletions

File tree

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,7 @@ static void byt_set_group_simple_mux(struct intel_pinctrl *vg,
668668

669669
padcfg0 = byt_gpio_reg(vg, group.grp.pins[i], BYT_CONF0_REG);
670670
if (!padcfg0) {
671-
dev_warn(vg->dev,
672-
"Group %s, pin %i not muxed (no padcfg0)\n",
671+
dev_warn(vg->dev, "Group %s, pin %i not muxed (can't retrieve CONF0)\n",
673672
group.grp.name, i);
674673
continue;
675674
}
@@ -698,8 +697,7 @@ static void byt_set_group_mixed_mux(struct intel_pinctrl *vg,
698697

699698
padcfg0 = byt_gpio_reg(vg, group.grp.pins[i], BYT_CONF0_REG);
700699
if (!padcfg0) {
701-
dev_warn(vg->dev,
702-
"Group %s, pin %i not muxed (no padcfg0)\n",
700+
dev_warn(vg->dev, "Group %s, pin %i not muxed (can't retrieve CONF0)\n",
703701
group.grp.name, i);
704702
continue;
705703
}
@@ -791,7 +789,7 @@ static int byt_gpio_request_enable(struct pinctrl_dev *pctl_dev,
791789
value |= gpio_mux;
792790
writel(value, reg);
793791

794-
dev_warn(vg->dev, FW_BUG "pin %u forcibly re-configured as GPIO\n", offset);
792+
dev_warn(vg->dev, FW_BUG "Pin %i: forcibly re-configured as GPIO\n", offset);
795793
}
796794

797795
raw_spin_unlock_irqrestore(&byt_lock, flags);
@@ -823,7 +821,9 @@ static void byt_gpio_direct_irq_check(struct intel_pinctrl *vg,
823821
* themselves in the foot.
824822
*/
825823
if (readl(conf_reg) & BYT_DIRECT_IRQ_EN)
826-
dev_info_once(vg->dev, "Potential Error: Setting GPIO with direct_irq_en to output");
824+
dev_info_once(vg->dev,
825+
"Potential Error: Pin %i: forcibly set GPIO with DIRECT_IRQ_EN to output\n",
826+
offset);
827827
}
828828

829829
static int byt_gpio_set_direction(struct pinctrl_dev *pctl_dev,
@@ -1026,9 +1026,7 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
10261026
if (val & BYT_INPUT_EN) {
10271027
val &= ~BYT_INPUT_EN;
10281028
writel(val, val_reg);
1029-
dev_warn(vg->dev,
1030-
"pin %u forcibly set to input mode\n",
1031-
offset);
1029+
dev_warn(vg->dev, "Pin %i: forcibly set to input mode\n", offset);
10321030
}
10331031

10341032
conf &= ~BYT_PULL_ASSIGN_MASK;
@@ -1048,9 +1046,7 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev,
10481046
if (val & BYT_INPUT_EN) {
10491047
val &= ~BYT_INPUT_EN;
10501048
writel(val, val_reg);
1051-
dev_warn(vg->dev,
1052-
"pin %u forcibly set to input mode\n",
1053-
offset);
1049+
dev_warn(vg->dev, "Pin %i: forcibly set to input mode\n", offset);
10541050
}
10551051

10561052
conf &= ~BYT_PULL_ASSIGN_MASK;
@@ -1256,18 +1252,15 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
12561252
pin = vg->soc->pins[i].number;
12571253
reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG);
12581254
if (!reg) {
1259-
seq_printf(s,
1260-
"Could not retrieve pin %i conf0 reg\n",
1261-
pin);
1255+
seq_printf(s, "Pin %i: can't retrieve CONF0\n", pin);
12621256
raw_spin_unlock_irqrestore(&byt_lock, flags);
12631257
continue;
12641258
}
12651259
conf0 = readl(reg);
12661260

12671261
reg = byt_gpio_reg(vg, pin, BYT_VAL_REG);
12681262
if (!reg) {
1269-
seq_printf(s,
1270-
"Could not retrieve pin %i val reg\n", pin);
1263+
seq_printf(s, "Pin %i: can't retrieve VAL\n", pin);
12711264
raw_spin_unlock_irqrestore(&byt_lock, flags);
12721265
continue;
12731266
}
@@ -1276,8 +1269,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
12761269

12771270
comm = byt_get_community(vg, pin);
12781271
if (!comm) {
1279-
seq_printf(s,
1280-
"Could not get community for pin %i\n", pin);
1272+
seq_printf(s, "Pin %i: can't retrieve community\n", pin);
12811273
continue;
12821274
}
12831275
label = gpiochip_is_requested(chip, i);
@@ -1429,7 +1421,7 @@ static int byt_irq_type(struct irq_data *d, unsigned int type)
14291421
value = readl(reg);
14301422

14311423
WARN(value & BYT_DIRECT_IRQ_EN,
1432-
"Bad pad config for io mode, force direct_irq_en bit clearing");
1424+
"Bad pad config for IO mode, force DIRECT_IRQ_EN bit clearing");
14331425

14341426
/* For level trigges the BYT_TRIG_POS and BYT_TRIG_NEG bits
14351427
* are used to indicate high and low level triggering
@@ -1476,9 +1468,7 @@ static void byt_gpio_irq_handler(struct irq_desc *desc)
14761468
reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG);
14771469

14781470
if (!reg) {
1479-
dev_warn(vg->dev,
1480-
"Pin %i: could not retrieve interrupt status register\n",
1481-
base);
1471+
dev_warn(vg->dev, "Pin %i: can't retrieve INT_STAT%u\n", base / 32, base);
14821472
continue;
14831473
}
14841474

@@ -1501,7 +1491,7 @@ static bool byt_direct_irq_sanity_check(struct intel_pinctrl *vg, int pin, u32 c
15011491
sizeof(direct_irq_mux));
15021492
match = memchr(direct_irq_mux, pin, sizeof(direct_irq_mux));
15031493
if (!match) {
1504-
dev_warn(vg->dev, FW_BUG "pin %i: direct_irq_en set but no IRQ assigned, clearing\n", pin);
1494+
dev_warn(vg->dev, FW_BUG "Pin %i: DIRECT_IRQ_EN set but no IRQ assigned, clearing\n", pin);
15051495
return false;
15061496
}
15071497

@@ -1528,7 +1518,8 @@ static bool byt_direct_irq_sanity_check(struct intel_pinctrl *vg, int pin, u32 c
15281518
trig = conf0 & BYT_TRIG_MASK;
15291519
if (trig != (BYT_TRIG_POS | BYT_TRIG_LVL) &&
15301520
trig != (BYT_TRIG_NEG | BYT_TRIG_LVL)) {
1531-
dev_warn(vg->dev, FW_BUG "pin %i: direct_irq_en set without trigger (conf0: %xh), clearing\n",
1521+
dev_warn(vg->dev,
1522+
FW_BUG "Pin %i: DIRECT_IRQ_EN set without trigger (CONF0: %#08x), clearing\n",
15321523
pin, conf0);
15331524
return false;
15341525
}
@@ -1555,9 +1546,7 @@ static void byt_init_irq_valid_mask(struct gpio_chip *chip,
15551546

15561547
reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG);
15571548
if (!reg) {
1558-
dev_warn(vg->dev,
1559-
"Pin %i: could not retrieve conf0 register\n",
1560-
i);
1549+
dev_warn(vg->dev, "Pin %i: could not retrieve CONF0\n", i);
15611550
continue;
15621551
}
15631552

@@ -1588,9 +1577,7 @@ static int byt_gpio_irq_init_hw(struct gpio_chip *chip)
15881577
reg = byt_gpio_reg(vg, base, BYT_INT_STAT_REG);
15891578

15901579
if (!reg) {
1591-
dev_warn(vg->dev,
1592-
"Pin %i: could not retrieve irq status reg\n",
1593-
base);
1580+
dev_warn(vg->dev, "Pin %i: can't retrieve INT_STAT%u\n", base / 32, base);
15941581
continue;
15951582
}
15961583

@@ -1600,7 +1587,7 @@ static int byt_gpio_irq_init_hw(struct gpio_chip *chip)
16001587
value = readl(reg);
16011588
if (value)
16021589
dev_err(vg->dev,
1603-
"GPIO interrupt error, pins misconfigured. INT_STAT%u: 0x%08x\n",
1590+
"GPIO interrupt error, pins misconfigured. INT_STAT%u: %#08x\n",
16041591
base / 32, value);
16051592
}
16061593

@@ -1764,9 +1751,7 @@ static int byt_gpio_suspend(struct device *dev)
17641751

17651752
reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG);
17661753
if (!reg) {
1767-
dev_warn(vg->dev,
1768-
"Pin %i: could not retrieve conf0 register\n",
1769-
i);
1754+
dev_warn(vg->dev, "Pin %i: can't retrieve CONF0\n", i);
17701755
continue;
17711756
}
17721757
value = readl(reg) & BYT_CONF0_RESTORE_MASK;
@@ -1796,9 +1781,7 @@ static int byt_gpio_resume(struct device *dev)
17961781

17971782
reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG);
17981783
if (!reg) {
1799-
dev_warn(vg->dev,
1800-
"Pin %i: could not retrieve conf0 register\n",
1801-
i);
1784+
dev_warn(vg->dev, "Pin %i: can't retrieve CONF0\n", i);
18021785
continue;
18031786
}
18041787
value = readl(reg);
@@ -1807,7 +1790,7 @@ static int byt_gpio_resume(struct device *dev)
18071790
value &= ~BYT_CONF0_RESTORE_MASK;
18081791
value |= vg->context.pads[i].conf0;
18091792
writel(value, reg);
1810-
dev_info(dev, "restored pin %d conf0 %#08x", i, value);
1793+
dev_info(dev, "restored pin %d CONF0 %#08x", i, value);
18111794
}
18121795

18131796
reg = byt_gpio_reg(vg, pin, BYT_VAL_REG);
@@ -1820,8 +1803,7 @@ static int byt_gpio_resume(struct device *dev)
18201803
v |= vg->context.pads[i].val;
18211804
if (v != value) {
18221805
writel(v, reg);
1823-
dev_dbg(dev, "restored pin %d val %#08x\n",
1824-
i, v);
1806+
dev_dbg(dev, "restored pin %d VAL %#08x\n", i, v);
18251807
}
18261808
}
18271809
}

0 commit comments

Comments
 (0)