Re: Incorrect uses of get_driver()/put_driver()

From: Joerg Roedel
Date: Mon Jan 09 2012 - 13:04:52 EST


On Mon, Jan 09, 2012 at 12:35:09PM -0500, Alan Stern wrote:
> lib/dma-debug.c:173: drv = get_driver(dev->driver);
> lib/dma-debug.c:188: put_driver(drv);
>
> Joerg, these calls don't seem to do anything, as far as I can tell.
> Is there any reason to keep them?

No reason to keep them :) It can be replaced with dev->driver, even
reference counting is not needed because only the pointer is kept and
never dereferenced.


Joerg

--
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/