diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index e5ab7cd..a7be0bc 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -533,9 +533,11 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
 	unsigned int index;
 	unsigned int match;
 
+#ifdef CONFIG_OF
 	/* look up via DT first */
 	if (dev && dev->of_node)
 		return of_pwm_request(dev->of_node, con_id);
+#endif
 
 	/*
 	 * We look up the provider in the static table typically provided by
