public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Harini Katakam <harinik@xilinx.com>,
	grant.likely@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com,
	mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
	galak@codeaurora.org, rob@landley.net, michals@xilinx.com,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 1/2] watchdog: Add Cadence WDT driver
Date: Wed, 02 Apr 2014 07:47:54 +0200	[thread overview]
Message-ID: <533BA48A.6040301@monstr.eu> (raw)
In-Reply-To: <533B5AAA.50707@roeck-us.net>

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

On 04/02/2014 02:32 AM, Guenter Roeck wrote:
> On 04/01/2014 04:20 AM, Michal Simek wrote:
>> Hi Guenter,
>>
>>>> +/**
>>>> + * struct cdns_wdt - Watchdog device structure
>>>> + * @regs: baseaddress of device
>>>> + * @rst: reset flag
>>>> + * @clk: struct clk * of a clock source
>>>> + * @prescaler: for saving prescaler value
>>>> + * @ctrl_clksel: counter clock prescaler selection
>>>> + * @io_lock: spinlock for IO register access
>>>> + * @cdns_wdt_device: watchdog device structure
>>>> + * @cdns_wdt_notifier: notifier structure
>>>> + *
>>>> + * Structure containing parameters specific to cadence watchdog.
>>>> + */
>>>> +struct cdns_wdt {
>>>> +    void __iomem        *regs;
>>>> +    u32            rst;
>>>> +    struct clk        *clk;
>>>> +    u32            prescaler;
>>>> +    u32            ctrl_clksel;
>>>> +    spinlock_t        io_lock;
>>>> +    struct watchdog_device    cdns_wdt_device;
>>>> +    struct notifier_block    cdns_wdt_notifier;
>>>> +};
>>>> +
>>>> +/* Write access to Registers */
>>>> +static inline void cdns_wdt_writereg(void __iomem *offset, u32 val)
>>>> +{
>>>> +    writel_relaxed(val, offset);
>>>> +}
>>>> +
>>>
>>> Not really sure if this function provides any value.
>>
>> I can't see any problem to use this helper IO function
>> but maybe we could do it a little bit differently.
>> Currently implementation is just passing values to writel_relaxed()
>>
>> What about to do it like this?
>>
>> static inline void cdns_wdt_writereg(struct cdns_wdt *wdt, u32 offset, u32 val)
>> {
>>      writel_relaxed(val, wdt->regs + offset);
>> }
>>
> Yes, that would make more sense.

ok good.
Harini: Please use this version instead.

Thanks,
Michal


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2014-04-02  5:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 10:31 [PATCH 1/2] watchdog: Add Cadence WDT driver Harini Katakam
2014-03-28 10:32 ` [PATCH 2/2] devicetree: Add Cadence WDT devicetree bindings documentation Harini Katakam
2014-03-31 10:30 ` [PATCH 1/2] watchdog: Add Cadence WDT driver One Thousand Gnomes
2014-04-01  0:24   ` Guenter Roeck
2014-04-01  0:32 ` Guenter Roeck
2014-04-01  7:35   ` Harini Katakam
2014-04-01 11:20   ` Michal Simek
2014-04-02  0:32     ` Guenter Roeck
2014-04-02  5:47       ` Michal Simek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-03-28 10:36 Harini Katakam

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=533BA48A.6040301@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=harinik@xilinx.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mark.rutland@arm.com \
    --cc=michals@xilinx.com \
    --cc=pawel.moll@arm.com \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox