All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ley Foon Tan <lftan-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
Cc: Jassi Brar
	<jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Suman Anna <s-anna-l0cyMroinI0@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH (resend)] mailbox: Add Altera mailbox driver
Date: Mon, 15 Dec 2014 08:22:23 -0600	[thread overview]
Message-ID: <548EEE9F.4030508@gmail.com> (raw)
In-Reply-To: <CAFiDJ58uQifY7th-mzvm2mjgJdw_MWmWFFhDPYT9TomOexiVNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>



On 12/15/14, 12:22 AM, Ley Foon Tan wrote:
> On Fri, Dec 12, 2014 at 10:38 PM, Dinh Nguyen <dinh.linux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
>>> +
>>> +#include <linux/kernel.h>
>>> +#include <linux/module.h>
>>> +#include <linux/device.h>
>>> +#include <linux/platform_device.h>
>>> +#include <linux/interrupt.h>
>>> +#include <linux/io.h>
>>> +#include <linux/of.h>
>>> +#include <linux/mailbox_controller.h>
>>
>> Alphabetize the headers.
> Okay.
> 
> 
>>> +static int altera_mbox_startup_sender(struct mbox_chan *chan)
>>> +{
>>> +     int ret;
>>> +     struct altera_mbox *mbox = to_altera_mbox(chan);
>>> +
>>> +     if (mbox->intr_mode) {
>>> +             ret = request_irq(mbox->irq, altera_mbox_tx_interrupt, 0,
>>
>> Use devm_request_irq, since you didn't have and don't need use free_irq
>> in the shutdown function.
> We want to free_irq when it shutdown. That means nobody requests for
> that mailbox (or channel) and request_irq() again if someone requests
> for a mailbox.
> 

But you didn't have any free_irq in the shutdown function. Use
devm_request_irq here, so you don't have to add them.

Dinh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Dinh Nguyen <dinh.linux@gmail.com>
To: Ley Foon Tan <lftan@altera.com>
Cc: Jassi Brar <jassisinghbrar@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Suman Anna <s-anna@ti.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH (resend)] mailbox: Add Altera mailbox driver
Date: Mon, 15 Dec 2014 08:22:23 -0600	[thread overview]
Message-ID: <548EEE9F.4030508@gmail.com> (raw)
In-Reply-To: <CAFiDJ58uQifY7th-mzvm2mjgJdw_MWmWFFhDPYT9TomOexiVNw@mail.gmail.com>



On 12/15/14, 12:22 AM, Ley Foon Tan wrote:
> On Fri, Dec 12, 2014 at 10:38 PM, Dinh Nguyen <dinh.linux@gmail.com> wrote:
> 
>>> +
>>> +#include <linux/kernel.h>
>>> +#include <linux/module.h>
>>> +#include <linux/device.h>
>>> +#include <linux/platform_device.h>
>>> +#include <linux/interrupt.h>
>>> +#include <linux/io.h>
>>> +#include <linux/of.h>
>>> +#include <linux/mailbox_controller.h>
>>
>> Alphabetize the headers.
> Okay.
> 
> 
>>> +static int altera_mbox_startup_sender(struct mbox_chan *chan)
>>> +{
>>> +     int ret;
>>> +     struct altera_mbox *mbox = to_altera_mbox(chan);
>>> +
>>> +     if (mbox->intr_mode) {
>>> +             ret = request_irq(mbox->irq, altera_mbox_tx_interrupt, 0,
>>
>> Use devm_request_irq, since you didn't have and don't need use free_irq
>> in the shutdown function.
> We want to free_irq when it shutdown. That means nobody requests for
> that mailbox (or channel) and request_irq() again if someone requests
> for a mailbox.
> 

But you didn't have any free_irq in the shutdown function. Use
devm_request_irq here, so you don't have to add them.

Dinh

  parent reply	other threads:[~2014-12-15 14:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15  6:22 [PATCH (resend)] mailbox: Add Altera mailbox driver Ley Foon Tan
2014-12-15  6:22 ` Ley Foon Tan
     [not found] ` <CAFiDJ58uQifY7th-mzvm2mjgJdw_MWmWFFhDPYT9TomOexiVNw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-15 14:22   ` Dinh Nguyen [this message]
2014-12-15 14:22     ` Dinh Nguyen
     [not found]     ` <548EEE9F.4030508-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-16  2:00       ` Ley Foon Tan
2014-12-16  2:00         ` Ley Foon Tan
  -- strict thread matches above, loose matches on Subject: below --
2014-12-12 10:04 Ley Foon Tan
2014-12-12 10:04 ` Ley Foon Tan
     [not found] ` <1418378690-3466-1-git-send-email-lftan-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org>
2014-12-12 14:38   ` Dinh Nguyen
2014-12-12 14:38     ` Dinh Nguyen
     [not found]     ` <548AFDE9.6000909-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-15 20:54       ` Suman Anna
2014-12-15 20:54         ` Suman Anna
     [not found]         ` <548F4A99.7040409-l0cyMroinI0@public.gmane.org>
2014-12-16  6:33           ` Ley Foon Tan
2014-12-16  6:33             ` Ley Foon Tan
2014-12-16 19:53             ` Suman Anna
2014-12-16 19:53               ` Suman Anna
     [not found]               ` <54908DAC.3090009-l0cyMroinI0@public.gmane.org>
2014-12-17  2:30                 ` Ley Foon Tan
2014-12-17  2:30                   ` Ley Foon Tan
     [not found]             ` <CAFiDJ5-b9qsLKj8Qh2+yx8_Y1nv5CG1PHyn2Se0zzZLSHWTKNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-17 17:17               ` Dinh Nguyen
2014-12-17 17:17                 ` Dinh Nguyen
     [not found]                 ` <5491BA90.9040007-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-18  2:08                   ` Ley Foon Tan
2014-12-18  2:08                     ` Ley Foon Tan

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=548EEE9F.4030508@gmail.com \
    --to=dinh.linux-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=lftan-EIB2kfCEclfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=s-anna-l0cyMroinI0@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.