From: Daniel Vetter <daniel@ffwll.ch>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Daniel Vetter <daniel@ffwll.ch>,
Keith Packard <keithp@keithp.com>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Benson Leung <bleung@chromium.org>,
Yufeng Shen <miletus@chromium.org>
Subject: Re: [PATCH 07/13 v4] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private
Date: Wed, 28 Mar 2012 15:05:42 +0200 [thread overview]
Message-ID: <20120328130542.GC27581@phenom.ffwll.local> (raw)
In-Reply-To: <1332873382-29373-8-git-send-email-djkurtz@chromium.org>
On Wed, Mar 28, 2012 at 02:36:16AM +0800, Daniel Kurtz wrote:
> This memory is always allocated, and it is always a fixed size, so just
> allocate it along with the rest of the driver state.
>
> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I've picked up all your patches up and including this one for d-i-n,
thanks. I'm a bit unhappy about the gmbus to gmbus pin off-by-one stuff in
the previous patch, but I could not come up with a better way to do it.
And merging these 2 enumerations into one sounds like a good idea, so I've
picked it up.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_i2c.c | 10 ----------
> 2 files changed, 1 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index c5ad7b9..6983b4b 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -326,7 +326,7 @@ typedef struct drm_i915_private {
> /** gt_lock is also taken in irq contexts. */
> struct spinlock gt_lock;
>
> - struct intel_gmbus *gmbus;
> + struct intel_gmbus gmbus[GMBUS_NUM_PORTS];
>
> /** gmbus_mutex protects against concurrent usage of the single hw gmbus
> * controller on different i2c buses. */
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index dcde6f6..c12db72 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -387,11 +387,6 @@ int intel_setup_gmbus(struct drm_device *dev)
> else
> dev_priv->gpio_mmio_base = 0;
>
> - dev_priv->gmbus = kcalloc(GMBUS_NUM_PORTS, sizeof(struct intel_gmbus),
> - GFP_KERNEL);
> - if (dev_priv->gmbus == NULL)
> - return -ENOMEM;
> -
> mutex_init(&dev_priv->gmbus_mutex);
>
> for (i = 0; i < GMBUS_NUM_PORTS; i++) {
> @@ -428,8 +423,6 @@ err:
> struct intel_gmbus *bus = &dev_priv->gmbus[i];
> i2c_del_adapter(&bus->adapter);
> }
> - kfree(dev_priv->gmbus);
> - dev_priv->gmbus = NULL;
> return ret;
> }
>
> @@ -468,7 +461,4 @@ void intel_teardown_gmbus(struct drm_device *dev)
> struct intel_gmbus *bus = &dev_priv->gmbus[i];
> i2c_del_adapter(&bus->adapter);
> }
> -
> - kfree(dev_priv->gmbus);
> - dev_priv->gmbus = NULL;
> }
> --
> 1.7.7.3
>
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
next prev parent reply other threads:[~2012-03-28 13:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 18:36 [PATCH 00/13 v4] fix gmbus writes and related issues Daniel Kurtz
2012-03-27 18:36 ` [PATCH 01/13 v4] drm/i915/intel_i2c: refactor gmbus_xfer Daniel Kurtz
2012-03-27 19:09 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 02/13 v4] drm/i915/intel_i2c: cleanup error messages and comments Daniel Kurtz
2012-03-27 18:46 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 03/13 v4] drm/i915/intel_i2c: assign HDMI port D to pin pair 6 Daniel Kurtz
2012-03-27 18:36 ` [PATCH 04/13 v4] drm/i915/intel_i2c: use i2c pre/post_xfer functions to setup gpio xfers Daniel Kurtz
2012-03-27 18:57 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 05/13 v4] drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter Daniel Kurtz
2012-03-27 18:36 ` [PATCH 06/13 v4] drm/i915/intel_i2c: gmbus disabled and reserved ports are invalid Daniel Kurtz
2012-03-27 18:36 ` [PATCH 07/13 v4] drm/i915/intel_i2c: allocate gmbus array as part of drm_i915_private Daniel Kurtz
2012-03-28 13:05 ` Daniel Vetter [this message]
2012-03-27 18:36 ` [PATCH 08/13 v4] drm/i915/intel_i2c: handle zero-length writes Daniel Kurtz
2012-03-27 19:14 ` Chris Wilson
2012-03-28 11:32 ` Daniel Kurtz
2012-03-28 11:39 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 09/13 v4] drm/i915/intel_i2c: use double-buffered writes Daniel Kurtz
2012-03-27 18:45 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 10/13 v4] drm/i915/intel_i2c: always wait for IDLE before clearing NAK Daniel Kurtz
2012-03-27 19:17 ` Chris Wilson
2012-03-27 18:36 ` [PATCH 11/13 v4] drm/i915/intel_i2c: use WAIT cycle, not STOP Daniel Kurtz
2012-03-27 18:36 ` [PATCH 12/13 v4] drm/i915/intel_i2c: use INDEX cycles for i2c read transactions Daniel Kurtz
2012-03-28 13:21 ` Daniel Vetter
2012-03-27 18:36 ` [PATCH 13/13 v4] drm/i915/intel_i2c: reuse GMBUS2 value read in polling loop Daniel Kurtz
2012-03-27 19:02 ` Chris Wilson
2012-03-28 11:39 ` Daniel Kurtz
2012-03-28 11:44 ` Chris Wilson
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=20120328130542.GC27581@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=bleung@chromium.org \
--cc=djkurtz@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=keithp@keithp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miletus@chromium.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
Powered by JetHome