drivers/pinconf.c: Remove redundant check for the existence of the member
Subsystems (2)
PATCH 1/1 drivers/pinconf.c: Remove redundant check for the existence of the member
"pin_config_set" in pinconf_ops.
In the function of registering pinctrl_dev, pinctrl_init_controller(), a non-null check has already been performed on the members pin_config_set and pin_config_group_set in the ops structure.
--- drivers/pinctrl/pinconf.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/pinctrl/pinconf.c +0 -9
@@ -158,10 +158,6 @@ int pinconf_apply_setting(const struct pinctrl_setting *setting)switch (setting->type) {case PIN_MAP_TYPE_CONFIGS_PIN : -if (!ops->pin_config_set) { -dev_err (pctldev->dev,"missing pin_config_set op\n" ); -return -EINVAL ; - } ret = ops->pin_config_set(pctldev, setting->data.configs.group_or_pin, setting->data.configs.configs,
@@ -174,11 +170,6 @@ int pinconf_apply_setting(const struct pinctrl_setting *setting) }break ;case PIN_MAP_TYPE_CONFIGS_GROUP : -if (!ops->pin_config_group_set) { -dev_err (pctldev->dev, -"missing pin_config_group_set op\n" ); -return -EINVAL ; - } ret = ops->pin_config_group_set(pctldev, setting->data.configs.group_or_pin, setting->data.configs.configs,
Signature · 1 line
2.34.1
Mon, May 15, 2023 at 12:59:32AM +0800, Lizhe kirjoitti:
Quoted 5 lines
"
pin_config_set" inpinconf_ops.In the function of registering
pinctrl_dev,pinctrl_init_controller(), a non-null check has already been performed on the memberspin_config_setandpin_config_group_setin the ops structure.
NAK.
Try to analyse what if (!foo && !bar) means from the logic perspective and deduce from that the problem in your proposal.
P.S. It's not the first wrong proposed change from you. Dunno if you even trying to read the code...
Signature · 2 lines
With Best Regards, Andy Shevchenko