[alsa-devel] [Intel-gfx] [PATCH v2 1/5] drm/i915: add dev_to_i915 helper

Daniel Vetter daniel at ffwll.ch
Tue Dec 9 11:08:31 CET 2014


On Tue, Dec 09, 2014 at 11:41:16AM +0200, Imre Deak wrote:
> +static inline struct drm_i915_private *dev_to_i915(struct device *dev)
> +{
> +	return to_i915(pci_get_drvdata(to_pci_dev(dev)));
> +}

dev_get_drvdata. No need to upcast to pci_dev for pci_get_drvdata to
downcast to device again. Let's really simplify this ;-)
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the Alsa-devel mailing list