[Prism54-devel] Broken DMA mask check
Jens Maurer
Jens.Maurer@gmx.net
Sun, 04 Jan 2004 19:36:42 +0100
This is a multi-part message in MIME format.
--------------000507040105030404020601
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Jens Maurer wrote:
> In prism54_probe(), we set the DMA mask of the device.
> The code is completely broken (see below): If the
> original all-ones DMA mask does not work, we try succeedingly
> smaller mask values until one fits.
I've attached a patch that fixes this. Plus makes the code
shorter and simpler :-)
Jens Maurer
--------------000507040105030404020601
Content-Type: text/plain;
name="set_dma_mask.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="set_dma_mask.patch"
SW5kZXg6IGlzbHBjaV9ob3RwbHVnLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL3Zhci9s
aWIvY3ZzL3ByaXNtNTQtbmcva3NyYy9pc2xwY2lfaG90cGx1Zy5jLHYKcmV0cmlldmluZyBy
ZXZpc2lvbiAxLjQ3CmRpZmYgLXUgLXUgLXIxLjQ3IGlzbHBjaV9ob3RwbHVnLmMKLS0tIGlz
bHBjaV9ob3RwbHVnLmMJMjYgRGVjIDIwMDMgMTY6MzI6MzEgLTAwMDAJMS40NworKysgaXNs
cGNpX2hvdHBsdWcuYwk0IEphbiAyMDA0IDE4OjM2OjEwIC0wMDAwCkBAIC0xMzQsNyArMTM0
LDYgQEAKIAl1OCBsYXRlbmN5X3RtcjsKIAlpc2xwY2lfcHJpdmF0ZSAqcHJpdjsKIAlpbnQg
cnZhbHVlOwotCWludCBkbWFfbWFzayA9IDB4ZmZmZmZmZmY7CiAKIAkvKiBUUkFDRShEUlZf
TkFNRSk7ICovCiAKQEAgLTE1NSwyMSArMTU0LDEyIEBACiAJCQkJICAgICAgUENJREVWSUNF
X0xBVEVOQ1lfVElNRVJfVkFMKTsKIAl9CiAKLQkvKiBkZXRlcm1pbmUgd2hh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