On Wed, Jul 31, 2019 at 10:11:46AM +0000, Pascal Van Leeuwen wrote: > > > > > +static int __init crypto_is_init(void) > > > > +{ > > > > + int rc; > > > > + > > > > + #if (IS_ENABLED(CONFIG_OF)) > > > > + /* Register platform driver */ > > > > + platform_driver_register(&crypto_safexcel); > > > > + #endif > > > > > > When used in the code directly, you should use: > > > > > > if (IS_ENABLED(CONFIG_OF)) > > > > > Oops, I missed that one, will fix. > > > Actually, I tried that first, but it doesn't work in this particular case. > The #if is really necessary here to avoid compile errors due to > references to datastructures that are within another #if ... (which refer > to functions with the #if etc. so it's a whole dependency chain) If you're going to use a #if then please don't indent it as that's not the kernel coding style. I see why you can't use a straight "if" because you've moved crypto_safexcel inside a #if, but what if you got rid of that #if too? IOW what would it take to make the probe function compile with CONFIG_OF off? In general we want to maximise compiler coverage under all config options so if we can make it compiler without too much effort that would be the preferred solution. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt