From: Daniel Kurtz Date: Tue, 27 Mar 2012 18:36:14 +0000 (+0800) Subject: drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter X-Git-Tag: v3.5-rc1~83^2~140^2~49 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bd7d90938f1fe77de5991dc4b727843c4980b2a;p=pandora-kernel.git drm/i915/intel_i2c: refactor using intel_gmbus_get_adapter Instead of letting other modules directly access the ->gmbus array, introduce intel_gmbus_get_adapter() for looking up an i2c_adapter for a given gmbus port identifier. This will enable later refactoring of the gmbus port list. Note: Before requesting an adapter for a given gmbus port number, the driver must first check its validity using i2c_intel_gmbus_is_port_valid(). If this check fails, a call to intel_gmbus_get_adapter() will WARN_ON and return NULL. This is relevant for parts of the driver that read a port from VBIOS, which might be improperly initialized and contain an invalid port. In these cases, the driver must fall back to using a safer default port. Signed-off-by: Daniel Kurtz Signed-off-by: Daniel Vetter --- Reading git-diff-tree failed