All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Sagar Dharia <sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	bp-l3A5Bk7waGM@public.gmane.org,
	poeschel-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org,
	treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	andreas.noever-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	daniel-/w4YWyX8dFk@public.gmane.org,
	oded.gabbay-5C7GfCeVMHo@public.gmane.org,
	jkosina-AlSwsSmVLrQ@public.gmane.org,
	sharon.dvir1-MQgwKvJRKlGYZoqfULhbRA@public.gmane.org,
	joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org,
	michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kheitke-hxvC4TZJLZFWk0Htik3J/w@public.gmane.org,
	mlocke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	agross-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V4 1/6] SLIMbus: Device management on SLIMbus
Date: Sat, 5 Mar 2016 14:01:09 +0900	[thread overview]
Message-ID: <20160305050109.GC18327@sirena.org.uk> (raw)
In-Reply-To: <1454784265-5194-2-git-send-email-sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]

On Sat, Feb 06, 2016 at 11:44:20AM -0700, Sagar Dharia wrote:

> +static void schedule_slim_report(struct slim_controller *ctrl,
> +				 struct slim_device *sb, bool report)
> +{
> +	struct sb_report_wd *sbw;
> +
> +	dev_dbg(&ctrl->dev, "report:%d for slave:%s\n", report, sb->name);
> +
> +	sbw = kmalloc(sizeof(*sbw), GFP_KERNEL);
> +	if (!sbw)
> +		return;
> +
> +	INIT_WORK(&sbw->wd, slim_report);
> +	sbw->sb = sb;
> +	sbw->report = report;
> +	if (!queue_work(ctrl->wq, &sbw->wd)) {
> +		dev_err(&ctrl->dev, "failed to queue report:%d slave:%s\n",
> +				    report, sb->name);
> +		kfree(sbw);
> +	}
> +}

I'm not 100% clear why we're scheduling this into a workqueue, it'd
probably help to at least explain what's going on in the code for future
reference.

> +}
> +/**

There's an awful lot of places in this which look like they're missing
blank lines.

> +ret_assigned_laddr:
> +	mutex_unlock(&ctrl->m_ctrl);
> +	if (exists || ret)
> +		return ret;
> +
> +	pr_info("setting slimbus l-addr:%x, ea:%x,%x,%x,%x\n",
> +		*laddr, e_addr->manf_id, e_addr->prod_code,
> +		e_addr->dev_index, e_addr->instance);

Not a dev_ print?

> +	slim = slim_query_device(ctrl, e_addr);
> +	if (!slim) {
> +		ret = -ENOMEM;

-ENOMEM?

> +static void __exit slimbus_exit(void)
> +{
> +	bus_unregister(&slimbus_type);
> +}
> +
> +static int __init slimbus_init(void)
> +{
> +	return bus_register(&slimbus_type);
> +}
> +postcore_initcall(slimbus_init);
> +module_exit(slimbus_exit);

Put the annotatations next to their functions.

> +MODULE_DESCRIPTION("Slimbus module");
> +MODULE_ALIAS("platform:slimbus");

This isn't a platform driver, it shouldn't have this alias.

> diff --git a/include/linux/slimbus.h b/include/linux/slimbus.h
> new file mode 100644
> index 0000000..2a78f79
> --- /dev/null
> +++ b/include/linux/slimbus.h

Probably good to add a module_slimbus_device() macro like other buses
have.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Sagar Dharia <sdharia@codeaurora.org>
Cc: gregkh@linuxfoundation.org, bp@suse.de, poeschel@lemonage.de,
	treding@nvidia.com, gong.chen@linux.intel.com,
	andreas.noever@gmail.com, alan@linux.intel.com,
	mathieu.poirier@linaro.org, daniel@ffwll.ch, oded.gabbay@amd.com,
	jkosina@suse.cz, sharon.dvir1@mail.huji.ac.il, joe@perches.com,
	davem@davemloft.net, james.hogan@imgtec.com,
	michael.opdenacker@free-electrons.com,
	daniel.thompson@linaro.org, robh+dt@kernel.org,
	pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	kheitke@audience.com, mlocke@codeaurora.org,
	agross@codeaurora.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH V4 1/6] SLIMbus: Device management on SLIMbus
Date: Sat, 5 Mar 2016 14:01:09 +0900	[thread overview]
Message-ID: <20160305050109.GC18327@sirena.org.uk> (raw)
In-Reply-To: <1454784265-5194-2-git-send-email-sdharia@codeaurora.org>

[-- Attachment #1: Type: text/plain, Size: 1900 bytes --]

On Sat, Feb 06, 2016 at 11:44:20AM -0700, Sagar Dharia wrote:

> +static void schedule_slim_report(struct slim_controller *ctrl,
> +				 struct slim_device *sb, bool report)
> +{
> +	struct sb_report_wd *sbw;
> +
> +	dev_dbg(&ctrl->dev, "report:%d for slave:%s\n", report, sb->name);
> +
> +	sbw = kmalloc(sizeof(*sbw), GFP_KERNEL);
> +	if (!sbw)
> +		return;
> +
> +	INIT_WORK(&sbw->wd, slim_report);
> +	sbw->sb = sb;
> +	sbw->report = report;
> +	if (!queue_work(ctrl->wq, &sbw->wd)) {
> +		dev_err(&ctrl->dev, "failed to queue report:%d slave:%s\n",
> +				    report, sb->name);
> +		kfree(sbw);
> +	}
> +}

I'm not 100% clear why we're scheduling this into a workqueue, it'd
probably help to at least explain what's going on in the code for future
reference.

> +}
> +/**

There's an awful lot of places in this which look like they're missing
blank lines.

> +ret_assigned_laddr:
> +	mutex_unlock(&ctrl->m_ctrl);
> +	if (exists || ret)
> +		return ret;
> +
> +	pr_info("setting slimbus l-addr:%x, ea:%x,%x,%x,%x\n",
> +		*laddr, e_addr->manf_id, e_addr->prod_code,
> +		e_addr->dev_index, e_addr->instance);

Not a dev_ print?

> +	slim = slim_query_device(ctrl, e_addr);
> +	if (!slim) {
> +		ret = -ENOMEM;

-ENOMEM?

> +static void __exit slimbus_exit(void)
> +{
> +	bus_unregister(&slimbus_type);
> +}
> +
> +static int __init slimbus_init(void)
> +{
> +	return bus_register(&slimbus_type);
> +}
> +postcore_initcall(slimbus_init);
> +module_exit(slimbus_exit);

Put the annotatations next to their functions.

> +MODULE_DESCRIPTION("Slimbus module");
> +MODULE_ALIAS("platform:slimbus");

This isn't a platform driver, it shouldn't have this alias.

> diff --git a/include/linux/slimbus.h b/include/linux/slimbus.h
> new file mode 100644
> index 0000000..2a78f79
> --- /dev/null
> +++ b/include/linux/slimbus.h

Probably good to add a module_slimbus_device() macro like other buses
have.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2016-03-05  5:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-06 18:44 [PATCH V4 0/6] Introduce framework for SLIMbus device drivers Sagar Dharia
2016-02-06 18:44 ` Sagar Dharia
     [not found] ` <1454784265-5194-1-git-send-email-sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-02-06 18:44   ` [PATCH V4 1/6] SLIMbus: Device management on SLIMbus Sagar Dharia
2016-02-06 18:44     ` Sagar Dharia
     [not found]     ` <1454784265-5194-2-git-send-email-sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-03-05  5:01       ` Mark Brown [this message]
2016-03-05  5:01         ` Mark Brown
2016-02-06 18:44 ` [PATCH V4 2/6] of/slimbus: OF helper for SLIMbus Sagar Dharia
2016-02-08 20:24   ` Rob Herring
2016-02-06 18:44 ` [PATCH V4 3/6] slimbus: Add messaging APIs to slimbus framework Sagar Dharia
2016-03-05  5:13   ` Mark Brown
2016-02-06 18:44 ` [PATCH V4 4/6] slim: qcom: Add Qualcomm Slimbus controller driver Sagar Dharia
2016-02-08 20:26   ` Rob Herring
     [not found]   ` <1454784265-5194-5-git-send-email-sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-03-05  5:23     ` Mark Brown
2016-03-05  5:23       ` Mark Brown
2016-04-15 16:17       ` Sagar Dharia
2016-04-18  9:19         ` Mark Brown
2016-04-18 22:42           ` Sagar Dharia
2016-02-06 18:44 ` [PATCH V4 5/6] slimbus: Add support for 'clock-pause' feature Sagar Dharia
2016-02-06 18:44 ` [PATCH V4 6/6] slim: qcom: Add runtime-pm support using clock-pause feature Sagar Dharia
2016-03-05  5:29   ` Mark Brown
2016-03-05  5:31 ` [PATCH V4 0/6] Introduce framework for SLIMbus device drivers Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160305050109.GC18327@sirena.org.uk \
    --to=broonie-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=agross-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=andreas.noever-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=bp-l3A5Bk7waGM@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=daniel.thompson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=gong.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=kheitke-hxvC4TZJLZFWk0Htik3J/w@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=michael.opdenacker-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=mlocke-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=oded.gabbay-5C7GfCeVMHo@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=poeschel-Xtl8qvBWbHwb1SvskN2V4Q@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sdharia-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=sharon.dvir1-MQgwKvJRKlGYZoqfULhbRA@public.gmane.org \
    --cc=treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.