Return-Path: Message-ID: <55F19651.8090908@intel.com> Date: Thu, 10 Sep 2015 16:40:17 +0200 From: Frederic Danis MIME-Version: 1.0 To: Marcel Holtmann , Frederic Danis CC: linux-bluetooth@vger.kernel.org Subject: Re: [PATCH v3 3/3] Bluetooth: hci_bcm: Add suspend/resume runtime PM functions References: <1441785286-5840-1-git-send-email-frederic.danis@linux.intel.com> <1441785286-5840-4-git-send-email-frederic.danis@linux.intel.com> <5F941F10-620B-4282-848E-895D52744850@holtmann.org> In-Reply-To: <5F941F10-620B-4282-848E-895D52744850@holtmann.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Sender: linux-bluetooth-owner@vger.kernel.org List-ID: SGVsbG8gTWFyY2VsLAoKT24gMDkvMDkvMjAxNSAxODoyOSwgTWFyY2VsIEhvbHRtYW5uIHdyb3Rl Ogo+IEhpIEZyZWQsCj4KPj4gQWRkcyBhdXRvc3VzcGVuZCBydW50aW1lIGZ1bmN0aW9uYWxpdHkg dG8gQkNNIFVBUlQgZHJpdmVyLgo+PiBBdXRvc3VzcGVuZCBpcyBlbmFibGVkIGF0IGVuZCBvZiBi Y21fc2V0dXAuCj4+Cj4+IEFkZCBhIHdvcmsgcXVldWUgdG8gYmUgYWJsZSB0byBwZXJmb3JtIHBt X3J1bnRpbWUgY29tbWFuZHMgZHVyaW5nIGJjbV9yZWN2Cj4+IHdoaWNoIGlzIGNhbGxlZCBieSBo Y2lfdWFydF90dHlfcmVjZWl2ZSgpIHVuZGVyIHNwaW5sb2NrLgo+IGlzIHRoYXQgYWN0dWFsbHkg YSByZXF1aXJlbWVudCBjb21pbmcgZnJvbSB0aGUgVFRZIHN1YnN5c3RlbT8gT3IgaXMgdGhhdCBz b21ldGhpbmcgdGhhdCB3ZSBpbmhlcml0ZWQgZnJvbSB3aGVuIEJsdWV0b290aCBzdWJzeXN0ZW0g d2FzIHVzaW5nIHRhc2tsZXRzIGFuZCB3ZSBuZXZlciBnb3QgYXJvdW5kIGZpeGluZyBpdC4gSWYg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