Skip to content

Commit 0988a0e

Browse files
committed
Merge tag 'for-v6.3-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull more power supply updates from Sebastian Reichel: - Fix DT binding for Richtek RT9467 - Fix a NULL pointer check in the power-supply core - Document meaning of absent "present" property * tag 'for-v6.3-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: dt-bindings: power: supply: Revise Richtek RT9467 compatible name ABI: testing: sysfs-class-power: Document absence of "present" property power: supply: fix null pointer check order in __power_supply_register
2 parents 3162745 + 13af134 commit 0988a0e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ What: /sys/class/power_supply/<supply_name>/present
437437
Date: May 2007
438438
439439
Description:
440-
Reports whether a battery is present or not in the system.
440+
Reports whether a battery is present or not in the system. If the
441+
property does not exist, the battery is considered to be present.
441442

442443
Access: Read
443444

Documentation/devicetree/bindings/power/supply/richtek,rt9467-charger.yaml renamed to Documentation/devicetree/bindings/power/supply/richtek,rt9467.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
22
%YAML 1.2
33
---
4-
$id: http://devicetree.org/schemas/power/supply/richtek,rt9467-charger.yaml#
4+
$id: http://devicetree.org/schemas/power/supply/richtek,rt9467.yaml#
55
$schema: http://devicetree.org/meta-schemas/core.yaml#
66

77
title: Richtek RT9467 Switching Battery Charger with Power Path Management
@@ -25,7 +25,7 @@ description: |
2525
2626
properties:
2727
compatible:
28-
const: richtek,rt9467-charger
28+
const: richtek,rt9467
2929

3030
reg:
3131
maxItems: 1
@@ -65,7 +65,7 @@ examples:
6565
#size-cells = <0>;
6666
6767
charger@5b {
68-
compatible = "richtek,rt9467-charger";
68+
compatible = "richtek,rt9467";
6969
reg = <0x5b>;
7070
wakeup-source;
7171
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_LEVEL_LOW>;

drivers/power/supply/power_supply_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,13 +1207,13 @@ __power_supply_register(struct device *parent,
12071207
struct power_supply *psy;
12081208
int rc;
12091209

1210+
if (!desc || !desc->name || !desc->properties || !desc->num_properties)
1211+
return ERR_PTR(-EINVAL);
1212+
12101213
if (!parent)
12111214
pr_warn("%s: Expected proper parent device for '%s'\n",
12121215
__func__, desc->name);
12131216

1214-
if (!desc || !desc->name || !desc->properties || !desc->num_properties)
1215-
return ERR_PTR(-EINVAL);
1216-
12171217
if (psy_has_property(desc, POWER_SUPPLY_PROP_USB_TYPE) &&
12181218
(!desc->usb_types || !desc->num_usb_types))
12191219
return ERR_PTR(-EINVAL);

0 commit comments

Comments
 (0)