[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIWbaLd87EMbkDAY@nanopsycho>
Date: Sun, 11 Jun 2023 12:01:12 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>
Cc: kuba@...nel.org, vadfed@...a.com, jonathan.lemon@...il.com,
pabeni@...hat.com, corbet@....net, davem@...emloft.net,
edumazet@...gle.com, vadfed@...com, jesse.brandeburg@...el.com,
anthony.l.nguyen@...el.com, saeedm@...dia.com, leon@...nel.org,
richardcochran@...il.com, sj@...nel.org, javierm@...hat.com,
ricardo.canuelo@...labora.com, mst@...hat.com, tzimmermann@...e.de,
michal.michalik@...el.com, gregkh@...uxfoundation.org,
jacek.lawrynowicz@...ux.intel.com, airlied@...hat.com,
ogabbay@...nel.org, arnd@...db.de, nipun.gupta@....com,
axboe@...nel.dk, linux@...y.sk, masahiroy@...nel.org,
benjamin.tissoires@...hat.com, geert+renesas@...der.be,
milena.olech@...el.com, kuniyu@...zon.com, liuhangbin@...il.com,
hkallweit1@...il.com, andy.ren@...cruise.com, razor@...ckwall.org,
idosch@...dia.com, lucien.xin@...il.com, nicolas.dichtel@...nd.com,
phil@....cc, claudiajkang@...il.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org, linux-rdma@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, poros@...hat.com,
mschmidt@...hat.com, linux-clk@...r.kernel.org,
vadim.fedorenko@...ux.dev
Subject: Re: [RFC PATCH v8 03/10] dpll: core: Add DPLL framework base
functions
Fri, Jun 09, 2023 at 02:18:46PM CEST, arkadiusz.kubalewski@...el.com wrote:
>From: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
[...]
>+ * dpll_xa_ref_dpll_first - find first record of given xarray
>+ * @xa_refs: xarray
>+ *
>+ * Context: shall be called under a lock (dpll_lock)
>+ * Return: first element on given xaaray
typo: xarray
>+ */
>+struct dpll_pin_ref *dpll_xa_ref_dpll_first(struct xarray *xa_refs)
[...]
>+/**
>+ * dpll_device_get - find existing or create new dpll device
>+ * @clock_id: clock_id of creator
>+ * @device_idx: idx given by device driver
>+ * @module: reference to registering module
>+ *
>+ * Get existing object of a dpll device, unique for given arguments.
>+ * Create new if doesn't exist yet.
>+ *
>+ * Context: Acquires a lock (dpll_lock)
>+ * Return:
>+ * * valid dpll_device struct pointer if succeeded
>+ * * ERR_PTR(-ENOMEM) - failed memory allocation
Yeah, that is kind of obvious, isn't? Really, drop this pointless
coments.
>+ * * ERR_PTR(X) - failed allocation on dpll's xa
>+ */
>+struct dpll_device *
>+dpll_device_get(u64 clock_id, u32 device_idx, struct module *module)
[...]
>+/**
>+ * dpll_pin_register - register the dpll pin in the subsystem
>+ * @dpll: pointer to a dpll
>+ * @pin: pointer to a dpll pin
>+ * @ops: ops for a dpll pin ops
>+ * @priv: pointer to private information of owner
>+ *
>+ * Context: Acquires a lock (dpll_lock)
>+ * Return:
>+ * * 0 on success
>+ * * -EINVAL - missing pin ops
>+ * * -ENOMEM - failed to allocate memory
Does not make sense to assign one errno to one specific error.
Avoid tables like this.
>+ */
>+int
>+dpll_pin_register(struct dpll_device *dpll, struct dpll_pin *pin,
>+ const struct dpll_pin_ops *ops, void *priv)
>+{
>+ int ret;
>+
>+ mutex_lock(&dpll_lock);
>+ if (WARN_ON(!(dpll->module == pin->module &&
>+ dpll->clock_id == pin->clock_id)))
>+ ret = -EFAULT;
-EINVAL;
>+ else
>+ ret = __dpll_pin_register(dpll, pin, ops, priv);
>+ mutex_unlock(&dpll_lock);
>+
>+ return ret;
>+}
[...]
Powered by blists - more mailing lists