Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	William Breathitt Gray <william.gray@linaro.org>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Demetrotion <pdemetrotion@winsystems.com>,
	techsupport@winsystems.com
Subject: Re: [PATCH v2] watchdog: ebc-c384_wdt: Migrate to the regmap API
Date: Tue, 14 Mar 2023 09:14:50 -0700	[thread overview]
Message-ID: <d6401cc5-990c-e46c-2d5c-148ce76c8b79@roeck-us.net> (raw)
In-Reply-To: <ZBCX0iVwYD4uVxwM@smile.fi.intel.com>

On 3/14/23 08:50, Andy Shevchenko wrote:
> On Tue, Mar 14, 2023 at 11:29:16AM -0400, William Breathitt Gray wrote:
>> The regmap API supports IO port accessors so we can take advantage of
>> regmap abstractions rather than handling access to the device registers
>> directly in the driver.
> 
> ...
> 
>>   - Utilize watchdog_set_drvdata() and watchdog_get_drvdata()
> 
> I'm wondering why you can't use dev_get_regmap() instead.
> 

That function is quite expensive to use in code that is called
for each register access. Its typical use is to get the regmap
for a driver once and store it in a local data structure, not
to use it for each access.

Guenter

>>   - Map watchdog control registers based on offset 0x1 and adjust regmap
>>     configurations accordingly; offset 0x0 is unused in this driver so we
>>     should avoid unnecessary exposure of it
> 
> I'm wondering what bad could happen if you expose it.
> 


  reply	other threads:[~2023-03-14 16:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 15:29 [PATCH v2] watchdog: ebc-c384_wdt: Migrate to the regmap API William Breathitt Gray
2023-03-14 15:50 ` Andy Shevchenko
2023-03-14 16:14   ` Guenter Roeck [this message]
2023-03-14 16:31   ` William Breathitt Gray
2023-03-14 16:42     ` Guenter Roeck
2023-03-14 17:47 ` Guenter Roeck
2023-04-02 14:07   ` William Breathitt Gray

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=d6401cc5-990c-e46c-2d5c-148ce76c8b79@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=pdemetrotion@winsystems.com \
    --cc=techsupport@winsystems.com \
    --cc=william.gray@linaro.org \
    --cc=wim@linux-watchdog.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