| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Tegra host1x Channel |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2010-2013, NVIDIA Corporation. |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 8 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 11 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 12 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 13 | | - * more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | 6 | */ |
|---|
| 18 | 7 | |
|---|
| 19 | 8 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 126 | 115 | |
|---|
| 127 | 116 | /** |
|---|
| 128 | 117 | * host1x_channel_request() - Allocate a channel |
|---|
| 129 | | - * @device: Host1x unit this channel will be used to send commands to |
|---|
| 118 | + * @client: Host1x client this channel will be used to send commands to |
|---|
| 130 | 119 | * |
|---|
| 131 | | - * Allocates a new host1x channel for @device. May return NULL if CDMA |
|---|
| 120 | + * Allocates a new host1x channel for @client. May return NULL if CDMA |
|---|
| 132 | 121 | * initialization fails. |
|---|
| 133 | 122 | */ |
|---|
| 134 | | -struct host1x_channel *host1x_channel_request(struct device *dev) |
|---|
| 123 | +struct host1x_channel *host1x_channel_request(struct host1x_client *client) |
|---|
| 135 | 124 | { |
|---|
| 136 | | - struct host1x *host = dev_get_drvdata(dev->parent); |
|---|
| 125 | + struct host1x *host = dev_get_drvdata(client->dev->parent); |
|---|
| 137 | 126 | struct host1x_channel_list *chlist = &host->channel_list; |
|---|
| 138 | 127 | struct host1x_channel *channel; |
|---|
| 139 | 128 | int err; |
|---|
| .. | .. |
|---|
| 144 | 133 | |
|---|
| 145 | 134 | kref_init(&channel->refcount); |
|---|
| 146 | 135 | mutex_init(&channel->submitlock); |
|---|
| 147 | | - channel->dev = dev; |
|---|
| 136 | + channel->client = client; |
|---|
| 137 | + channel->dev = client->dev; |
|---|
| 148 | 138 | |
|---|
| 149 | 139 | err = host1x_hw_channel_init(host, channel, channel->id); |
|---|
| 150 | 140 | if (err < 0) |
|---|
| .. | .. |
|---|
| 159 | 149 | fail: |
|---|
| 160 | 150 | clear_bit(channel->id, chlist->allocated_channels); |
|---|
| 161 | 151 | |
|---|
| 162 | | - dev_err(dev, "failed to initialize channel\n"); |
|---|
| 152 | + dev_err(client->dev, "failed to initialize channel\n"); |
|---|
| 163 | 153 | |
|---|
| 164 | 154 | return NULL; |
|---|
| 165 | 155 | } |
|---|