From: Tom Van Braeckel Date: Tue, 31 Mar 2015 14:39:21 +0000 (+0200) Subject: misc: pass miscdevice through file's private_data X-Git-Tag: omap-for-v4.1/fixes-rc1~73^2~30 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b509d8d336eef6d622d66b3ae2a1fc3a072bf92;p=pandora-kernel.git misc: pass miscdevice through file's private_data Make the miscdevice accessible through the file's private_data. Previously, this was done only when an open() file operation had been registered. If no custom open() file operation was defined, private_data was set to NULL. This subtle quirk was confusing, to the point where kernel code registered *empty* file open operations to have private_data point to the misc device structure and avoid duplicating that logic. And it could easily lead to bugs, where the addition or removal of a custom open() file operation surprisingly changes the initial value of a file's private_data structure. To resolve this, we now place the miscdevice in the file's private_data member unconditionally when open() is called. Signed-off-by: Tom Van Braeckel Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed