mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 23:57:30 -04:00
mmc-fdt: fix mmc_fdt_gpio_get_{present,readonly}
Currently, mmc_fdt_gpio_get_{present,readonly} return all time true.
true ^ 100b = true
false ^ 100b = true
since that's done after promotion to integers. Use !! to convert
the bit to a bool before xor.
Reviewed by: imp@ (converted to (bool) to !! for portability)
Pull Request: https://github.com/freebsd/freebsd-src/pull/461
This commit is contained in:
parent
43521b46fc
commit
cfae21201a
1 changed files with 2 additions and 2 deletions
|
|
@ -407,7 +407,7 @@ mmc_fdt_gpio_get_present(struct mmc_fdt_helper *helper)
|
|||
|
||||
gpio_pin_is_active(helper->cd_pin, &pinstate);
|
||||
|
||||
return (pinstate ^ (helper->props & MMC_PROP_CD_INVERTED));
|
||||
return (pinstate ^ !!(helper->props & MMC_PROP_CD_INVERTED));
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -423,7 +423,7 @@ mmc_fdt_gpio_get_readonly(struct mmc_fdt_helper *helper)
|
|||
|
||||
gpio_pin_is_active(helper->wp_pin, &pinstate);
|
||||
|
||||
return (pinstate ^ (helper->props & MMC_PROP_WP_INVERTED));
|
||||
return (pinstate ^ !!(helper->props & MMC_PROP_WP_INVERTED));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue