mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
pwm: pxa: Depend on OF and simplify accordingly
The SoCs that this driver actually works on all imply OF already. (ARM selects USE_OF unless some archs are enabled that cannot be selected together with ARCH_PXA or ARCH_MMP, ARM64 and RISCV select OF.) With OF known to be enabled a few conditionals in the driver can be simplified. Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/20260705083910.3502207-2-u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
This commit is contained in:
parent
1a4920940e
commit
7945aa9848
|
|
@ -569,7 +569,7 @@ config PWM_PCA9685
|
|||
config PWM_PXA
|
||||
tristate "PXA PWM support"
|
||||
depends on ARCH_PXA || ARCH_MMP || ARCH_SPACEMIT || COMPILE_TEST
|
||||
depends on HAS_IOMEM
|
||||
depends on HAS_IOMEM && OF
|
||||
help
|
||||
Generic PWM framework driver for PXA.
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@ static const struct pwm_ops pxa_pwm_ops = {
|
|||
.apply = pxa_pwm_apply,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
/*
|
||||
* Device tree users must create one device instance for each PWM channel.
|
||||
* Hence we dispense with the HAS_SECONDARY_PWM and "tell" the original driver
|
||||
|
|
@ -152,9 +151,6 @@ static const struct of_device_id pwm_of_match[] = {
|
|||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, pwm_of_match);
|
||||
#else
|
||||
#define pwm_of_match NULL
|
||||
#endif
|
||||
|
||||
static int pwm_probe(struct platform_device *pdev)
|
||||
{
|
||||
|
|
@ -166,7 +162,7 @@ static int pwm_probe(struct platform_device *pdev)
|
|||
struct reset_control *rst;
|
||||
int ret = 0;
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF) && id == NULL)
|
||||
if (id == NULL)
|
||||
id = of_device_get_match_data(dev);
|
||||
|
||||
if (id == NULL)
|
||||
|
|
@ -192,9 +188,7 @@ static int pwm_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(rst);
|
||||
|
||||
chip->ops = &pxa_pwm_ops;
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF))
|
||||
chip->of_xlate = of_pwm_single_xlate;
|
||||
chip->of_xlate = of_pwm_single_xlate;
|
||||
|
||||
pc->mmio_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(pc->mmio_base))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user