But there is no compilation requirement for that.Yes. that is what I meant by adding depends on OF. Thanks.
If you want to tell that this is functional requirement, you may use
depends on COMPILE_TEST || OF
pattern
...
+ struct device *dev = &pdev->dev;
+ struct led_init_data init_data = {};
+ struct led_classdev *cdev;
+ struct mc_subled *subled;
+ struct led_mcg_priv *priv;