Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199527

Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver

From Paul Bolle <pebolle@tiscali.nl>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver
Date 2015-08-04 10:40 +0200
Message-ID <pTFVo-5cP-17@gated-at.bofh.it> (permalink)
References <pTcA1-4np-11@gated-at.bofh.it> <pTcA1-4np-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


(This RFC was part of this mornings catch of my crude mail filter. So,
for what it's worth, what follows are a few random comments for the few
things I'm able to spot.)

On ma, 2015-08-03 at 09:13 +0800, Leo Yan wrote:
> --- /dev/null
> +++ b/drivers/mailbox/hisilicon/Kconfig

> +config HISI_MBOX
> +	bool "Hisilicon's Mailbox"
> +	depends on ARCH_HISI || OF

ARCH_HISI is available on either ARM64 or ARM. ARM64 selects OF. On ARM
ARCH_HISI depends on ARCH_MULTIV7 which depends on ARCH_MULTIPLATFORM.
That selects USE_OF which on its turn selects OF.

So, HISI_MBOX implies OF, correct?

> +	help
> +	  Support for mailbox drivers on Hisilicon series of SoCs.
> +
> +config HI6220_MBOX
> +	tristate "Hi6220 Mailbox Controller"
> +	depends on HISI_MBOX
> +	help
> +	  An implementation of the hi6220 mailbox. It is used to send message
> +	  between application processors and MCU. Say Y here if you want to build
> +	  the Hi6220 mailbox controller driver.

> --- /dev/null
> +++ b/drivers/mailbox/hisilicon/common.c

> +int hisi_mbox_register(struct hisi_mbox_hw *mbox_hw)
> +{
> +	[...]
> +
> +	mbox->chan = devm_kzalloc(dev,
> +		mbox_hw->chan_num * sizeof(struct mbox_chan), GFP_KERNEL);
> +	if (!mbox)

	if (!mbox->chan)

> +		return -ENOMEM;
> +
> +	[...]
> +}

> --- /dev/null
> +++ b/drivers/mailbox/hisilicon/hi6220-mailbox.c

> +static struct platform_driver hi6220_mbox_driver = {
> +	.driver = {
> +		[...]
> +		.of_match_table = of_match_ptr(hi6220_mbox_of_match),

of_match_ptr(x) becomes NULL when CONFIG_OF is not defined. But I think
CONFIG_OF will always be defined, see above. So of_match_ptr() isn't per
se needed.

> +	},
> +	[...]
> +};

> +static int __init hi6220_mbox_init(void)
> +{
> +	return platform_driver_register(&hi6220_mbox_driver);
> +}
> +module_init(hi6220_mbox_init);
> +
> +static void __exit hi6220_mbox_exit(void)
> +{
> +	platform_driver_unregister(&hi6220_mbox_driver);
> +}
> +module_exit(hi6220_mbox_exit);

This could be flattened into one line:
    module_platform_driver(hi6220_mbox_driver);

Thanks,


Paul Bolle
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH 0/3] mailbox: hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-03 03:20 +0200
  [RFC PATCH 3/3] arm64: dts: add Hi6220 mailbox node Leo Yan <leo.yan@linaro.org> - 2015-08-03 03:20 +0200
  [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-03 03:20 +0200
    Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Paul Bolle <pebolle@tiscali.nl> - 2015-08-04 10:40 +0200
      Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-04 10:50 +0200
        Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-04 11:10 +0200
        Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Paul Bolle <pebolle@tiscali.nl> - 2015-08-04 11:20 +0200
          Re: [RFC PATCH 2/3] mailbox: Hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-04 12:00 +0200
  [RFC PATCH 1/3] dt-bindings: mailbox: Document Hisilicon mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-03 03:20 +0200
  Re: [RFC PATCH 0/3] mailbox: hisilicon: add mailbox driver Jassi Brar <jassisinghbrar@gmail.com> - 2015-08-05 13:00 +0200
    Re: [RFC PATCH 0/3] mailbox: hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-06 01:20 +0200
      Re: [RFC PATCH 0/3] mailbox: hisilicon: add mailbox driver Jassi Brar <jassisinghbrar@gmail.com> - 2015-08-10 09:10 +0200
        Re: [RFC PATCH 0/3] mailbox: hisilicon: add mailbox driver Leo Yan <leo.yan@linaro.org> - 2015-08-10 11:00 +0200

csiph-web