On Mon, Apr 06, 2020 at 02:58:17AM +0200, Laurent Pinchart wrote: > On Tue, Mar 31, 2020 at 04:16:29PM +0200, Vincent Whitchurch wrote: > > int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) > > { > > unsigned int offset = adv7511->type == ADV7533 ? > > ADV7533_REG_CEC_OFFSET : 0; > > - int ret = adv7511_cec_parse_dt(dev, adv7511); > > + int ret; > > > > - if (ret) > > - goto err_cec_parse_dt; > > + if (!adv7511->cec_clk) > > + goto err_cec_no_clock; > > + > > + clk_prepare_enable(adv7511->cec_clk); > > + adv7511->cec_clk_freq = clk_get_rate(adv7511->cec_clk); > > > > adv7511->cec_adap = cec_allocate_adapter(&adv7511_cec_adap_ops, > > adv7511, dev_name(dev), CEC_CAP_DEFAULTS, ADV7511_MAX_ADDRS); > > @@ -342,8 +331,11 @@ int adv7511_cec_init(struct device *dev, struct adv7511 *adv7511) > > err_cec_alloc: > > dev_info(dev, "Initializing CEC failed with error %d, disabling CEC\n", > > ret); > > -err_cec_parse_dt: > > + clk_disable_unprepare(adv7511->cec_clk); > > + /* Ensure that adv7511_remove() doesn't attempt to disable it again. */ > > Would it make sense to call devm_clk_put() here to already release the > clock ? I've just sent out a v2 with this added. Thank you for the review! _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel