| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2017 James.Bottomley@HansenPartnership.com |
|---|
| 3 | | - * |
|---|
| 4 | | - * GPLv2 |
|---|
| 5 | 4 | */ |
|---|
| 6 | 5 | #include <linux/slab.h> |
|---|
| 7 | 6 | #include "tpm-dev.h" |
|---|
| .. | .. |
|---|
| 28 | 27 | return -ENOMEM; |
|---|
| 29 | 28 | } |
|---|
| 30 | 29 | |
|---|
| 31 | | - tpm_common_open(file, chip, &priv->priv); |
|---|
| 30 | + tpm_common_open(file, chip, &priv->priv, &priv->space); |
|---|
| 32 | 31 | |
|---|
| 33 | 32 | return 0; |
|---|
| 34 | 33 | } |
|---|
| .. | .. |
|---|
| 45 | 44 | return 0; |
|---|
| 46 | 45 | } |
|---|
| 47 | 46 | |
|---|
| 48 | | -static ssize_t tpmrm_write(struct file *file, const char __user *buf, |
|---|
| 49 | | - size_t size, loff_t *off) |
|---|
| 50 | | -{ |
|---|
| 51 | | - struct file_priv *fpriv = file->private_data; |
|---|
| 52 | | - struct tpmrm_priv *priv = container_of(fpriv, struct tpmrm_priv, priv); |
|---|
| 53 | | - |
|---|
| 54 | | - return tpm_common_write(file, buf, size, off, &priv->space); |
|---|
| 55 | | -} |
|---|
| 56 | | - |
|---|
| 57 | 47 | const struct file_operations tpmrm_fops = { |
|---|
| 58 | 48 | .owner = THIS_MODULE, |
|---|
| 59 | 49 | .llseek = no_llseek, |
|---|
| 60 | 50 | .open = tpmrm_open, |
|---|
| 61 | 51 | .read = tpm_common_read, |
|---|
| 62 | | - .write = tpmrm_write, |
|---|
| 52 | + .write = tpm_common_write, |
|---|
| 53 | + .poll = tpm_common_poll, |
|---|
| 63 | 54 | .release = tpmrm_release, |
|---|
| 64 | 55 | }; |
|---|
| 65 | | - |
|---|