[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250828103302.GZ10519@horms.kernel.org>
Date: Thu, 28 Aug 2025 11:33:02 +0100
From: Simon Horman <horms@...nel.org>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
anthony.l.nguyen@...el.com, przemyslaw.kitszel@...el.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
Aleksandr Loktionov <aleksandr.loktionov@...el.com>
Subject: Re: [PATCH iwl-next v1] ice: add support for unmanaged dpll on E830
NIC
On Tue, Aug 26, 2025 at 05:31:18PM +0200, Arkadiusz Kubalewski wrote:
...
> diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c
...
> +/**
> + * ice_dpll_init_info_unmanaged - init dpll information for unmanaged dpll
> + * @pf: board private structure
> + *
> + * Acquire (from HW) and set basic dpll information (on pf->dplls struct).
> + * For unmanaged dpll mode.
> + *
> + * Return:
> + * * 0 - success
> + * * negative - init failure reason
> + */
> +static int ice_dpll_init_info_unmanaged(struct ice_pf *pf)
> +{
> + struct ice_dplls *d = &pf->dplls;
> + struct ice_dpll *de = &d->eec;
> + int ret = 0;
> +
> + d->clock_id = ice_generate_clock_id(pf);
> + d->num_inputs = ice_cgu_get_pin_num(&pf->hw, true);
> + d->num_outputs = ice_cgu_get_pin_num(&pf->hw, false);
> + ice_dpll_lock_state_init_unmanaged(pf);
> +
> + d->inputs = kcalloc(d->num_inputs, sizeof(*d->inputs), GFP_KERNEL);
> + if (!d->inputs)
> + return -ENOMEM;
> +
> + ret = ice_dpll_init_pins_info(pf, ICE_DPLL_PIN_TYPE_INPUT);
> + if (ret)
> + goto deinit_info;
> +
> + d->outputs = kcalloc(d->num_outputs, sizeof(*d->outputs), GFP_KERNEL);
> + if (!d->outputs)
Hi Arkadiusz,
I think the following is needed here:
err = -ENOMEM;
Flagged by Smatch.
> + goto deinit_info;
> +
> + ret = ice_dpll_init_pins_info(pf, ICE_DPLL_PIN_TYPE_OUTPUT);
> + if (ret)
> + goto deinit_info;
> +
> + de->mode = DPLL_MODE_AUTOMATIC;
> + dev_dbg(ice_pf_to_dev(pf), "%s - success, inputs:%u, outputs:%u\n",
> + __func__, d->num_inputs, d->num_outputs);
> + return 0;
> +deinit_info:
> + dev_err(ice_pf_to_dev(pf), "%s - fail: d->inputs:%p, d->outputs:%p\n",
> + __func__, d->inputs, d->outputs);
> + ice_dpll_deinit_info(pf);
> + return ret;
> +}
...
Powered by blists - more mailing lists