Yep makes sense,bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");In the case of !bdev->controlled_remotely I think this should still be
- if (IS_ERR(bdev->bamclk))
- return PTR_ERR(bdev->bamclk);
-
- ret = clk_prepare_enable(bdev->bamclk);
- if (ret) {
- dev_err(bdev->dev, "failed to prepare/enable clock\n");
- return ret;
+ if (IS_ERR(bdev->bamclk)) {
an error.
Yep, with above change, this block should be unchanged.+ bdev->bamclk = NULL;The rest of the driver will keep operating the bamclk (which is okay),
+ } else {
+ ret = clk_prepare_enable(bdev->bamclk);
+ if (ret) {
+ dev_err(bdev->dev, "failed to prepare/enable clock\n");
+ return ret;
+ }
so for symmetry purposes I think you should just keep the
clk_prepare_enable() block unmodified.
Regards,
Bjorn