Exemple #1
0
static void anx7808_unvote_usb_clk(void *data)
{
	struct anx7808_data *anx7808 = data;

	if (!anx7808->usb_clk)
		return;

	if (1 == __atomic_add_unless(&anx7808->usb_clk_count, -1, 0)) {
		pr_info("usb clk is unvoted\n");
		clk_disable_unprepare(anx7808->usb_clk);
	}
}
Exemple #2
0
/*
 * wake up an asynchronous call
 */
static void afs_wake_up_async_call(struct sock *sk, struct rxrpc_call *rxcall,
				   unsigned long call_user_ID)
{
	struct afs_call *call = (struct afs_call *)call_user_ID;
	int u;

	trace_afs_notify_call(rxcall, call);
	call->need_attention = true;

	u = __atomic_add_unless(&call->usage, 1, 0);
	if (u != 0) {
		trace_afs_call(call, afs_call_trace_wake, u,
			       atomic_read(&call->net->nr_outstanding_calls),
			       __builtin_return_address(0));

		if (!queue_work(afs_async_calls, &call->async_work))
			afs_put_call(call);
	}
}